Download the PHP package zeroframe/zerorouter without Composer

On this page you can find all versions of the php package zeroframe/zerorouter. 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 zerorouter

PHP ZeroRouter

It's a light and very fast router able to mix different strategies and you can also implement your own.
The router is based on PSR-7 and we suggest use a fast implementation like nyholm/psr7 and nyholm/psr7-server.
You can use this Router in your Middleware or as standalone component.

The main target is to give a linear complexity to the problem and strategies like PrefixBlockLookupStrategy and SuffixBlockLookupStrategy works well for reaching the target.

Below each strategy is explained.

HeaderKeyLookupStrategy

Skip all strategies and use the header key X-Routing-Key for matching directly your route and get best performance. Could be useful with microservices and large dynamic maps.

Support only dynamic routes.

PrefixBlockLookupStrategy

This strategy splits the url by blocks and each block is delimited by a '/'. We create a map only with static parts before the dynamic route.

Example:

Route: /comments/sport/{id}

map: [ 'comments' => [ 'sport' => [ 'regsex' => [...] ] ] ]

The strategy will try lookup each block directly in array map, if a block it's not found then we try check on the last block found if exists a node "regsex" and then we try to match the regular expressions. With this strategy you can have large dynamic maps without having bad performance because the access to the array is very fast and at every access you are limiting the data to few regular expressions.

Following the previous example with this URL: /comments/sport/8041984 PrefixBlockLookupStrategy will do these steps:

handles URLS where the static part is before the dynamic route:

/users/{id} /users/comments/{id} /profiles/{activity}/id

SuffixBlockLookupStrategy

Apply same strategy used by PrefixBlockLookupStrategy but in reverse order working only on suffixes.

handles URLS where the static part is after the dynamic route:

/{id}/users /{id}/comments/users /{id}/{activity}/profiles

StaticKeyLookupStrategy

Basic and best strategy for static routes.

/dummy
/php
/dave

GenericBlockRegexLookupStrategy

This strategy tries to match only generic regular expression, a generic regex contains only dynamic routes without static part in the url.

Install with composer

basic usage:


All versions of zerorouter with dependencies

PHP Build Version
Package Version
Requires psr/http-message Version ^1.0
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 zeroframe/zerorouter contains the following files

Loading the files please wait ....