Download the PHP package mnavarrocarter/path-to-regexp-php without Composer

On this page you can find all versions of the php package mnavarrocarter/path-to-regexp-php. 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 path-to-regexp-php

MNC PathToRegExpPHP

Actions Status

Turns an Express-style path string such as /user/:name into a regular expression, so it can be used in routing engines.

This is an Object Oriented port of the famous JS library path-to-regexp, used by Node's Express and other js frameworks.

The hard work of porting the JS library to PHP was done originally done by Gil Polguère. He did the hard part.

I just added the following features:

  1. Bumped PHP to 7.2 minimum
  2. Added type hints where possible
  3. Removed all the arrays passed by reference and used objects to store that state instead.

Usage

You have several flags you can pass as options of the create method:

By default, the only flag enabled in the create method is PathRegExpFactory::END.

Parameters

The path has the ability to define parameters and automatically populate the keys array.

Named Parameters

Named parameters are defined by prefixing a colon to the parameter name (:foo). By default, this parameter will match up to the next path segment.

Suffixed Parameters

Optional

Parameters can be suffixed with a question mark (?) to make the entire parameter optional. This will also make any prefixed path delimiter optional (/ or .).

Zero or more

Parameters can be suffixed with an asterisk (*) to denote a zero or more parameter match. The prefixed path delimiter is also taken into account for the match.

One or more

Parameters can be suffixed with a plus sign (+) to denote a one or more parameters match. The prefixed path delimiter is included in the match.

Custom Match Parameters

All parameters can be provided a custom matching regexp and override the default.

Please note: Backslashes need to be escaped in strings.

Unnamed Parameters

It is possible to write an unnamed parameter that is only a matching group. It works the same as a named parameter, except it will be numerically indexed.


All versions of path-to-regexp-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
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 mnavarrocarter/path-to-regexp-php contains the following files

Loading the files please wait ....