Download the PHP package vstelmakh/url-highlight without Composer

On this page you can find all versions of the php package vstelmakh/url-highlight. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package url-highlight


Build status Packagist version PHP version

Url highlight - PHP library to parse URLs from string input. Works with complex URLs, edge cases and encoded input.

Features:

🚀 See examples 👀

Installation

Install the latest version with Composer:

Also, there are Twig extension and Symfony bundle available.

Quick start

💡 Tip: For customizing highlight see Highlighter. To properly handle HTML entity escaped string see Encoder.

Usage

Check if string is URL

Parse URLs from string

Replace URLs by HTML tags (make clickable)

Configuration

There are 3 parts which could be configured according to your needs:

Configuration provided via constructor implementing corresponding interface instance. Use null to keep default:

Validator

There is one validator bundled with the library. Which is used by default with settings listed in example below.

🛠️ Validator usage example

💡 Tip: If you need custom behavior - create and use your own validator implementing ValidatorInterface.

Highlighter

There are 2 highlighters bundled with the library:

By default, HtmlHighlighter is used, with settings listed in example below.

🛠️ Highlighter usage example

💡 Tip: If you need custom behavior - extend HighlighterInterface.
For more details and examples see 🖍️ Custom highlighter.

Encoder

Encoder should be used to handle encoded input properly. For example HTML escaped string could contain something like: http://example.com?a=1" or http://example.com?a=1&b=2 which will be wrongly matched as URL.

By default, there is no encoder used. There are 2 encoders bundled with library:

🛠️ Encoder usage example

💡 Tip: For custom behavior - create and use your own encoder implementing EncoderInterface.
Keep in mind - using encoder require more regex operations and could have performance impact. Better to not use encoder if you don't expect encoded string.

Credits

Volodymyr Stelmakh
Licensed under the MIT License. See LICENSE for more information.


All versions of url-highlight with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1 || ^8
ext-json Version *
ext-mbstring Version *
symfony/polyfill-php72 Version ^1.10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vstelmakh/url-highlight contains the following files

Loading the files please wait ....