Download the PHP package ellipse/router-fastroute without Composer

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

FastRoute

FastRoute Psr-15 middleware and request handler.

Require php >= 7.0

Installation composer require ellipse/router-fastroute

Run tests ./vendor/bin/kahlan

Usage as request handler

This package provides an Ellipse\Router\FastRouteRequestHandler Psr-15 request handler taking a fastroute dispatcher factory as parameter.

This factory can be any callable returning an implementation of FastRoute\Dispatcher and the route handlers it matches are expected to be implementations of Psr\Http\Server\RequestHandlerInterface.

When the FastRouteRequestHandler handles a request the Dispatcher produced by the factory is used to match a Psr-15 request handler. When the matched route pattern contains placeholders, a new request is created with those placeholders => matched value pairs as request attributes. Finally the matched request handler is proxied with this new request to actually return a response.

Using a factory allows to perform the time consuming task of mapping routes only when the request is handled with the FastRouteRequestHandler. If for some reason an application handles the incoming request with another request handler, no time is lost mapping routes for this one.

Regarding exceptions:

Usage as middleware

This package provides an Ellipse\Router\FastRouteMiddleware Psr-15 middleware also taking a fastroute dispatcher factory as parameter.

Under the hood it creates a FastRouteRequestHandler with the given factory and use it to handle the request. When a NotFoundException is thrown, the request processing is delegated to the next middleware.

Group count based middleware and request handler

As fastroute dispatchers are usually group count based, this package provides an Ellipse\Router\FastRoute\GroupCountBasedMiddleware and an Ellipse\Router\FastRoute\GroupCountBasedRequestHandler taking only a route definition callback as parameter allowing to easily create group count based fastroute middleware and request handler.

Dispatcher factories helpers

This package provides two dispatcher factories helpers proxying the fastroute ones: Ellipse\Router\FastRoute\SimpleDispatcher and Ellipse\Router\FastRoute\CachedDispatcher.

Those two classes are just callables proxying their respective fastroute functions to produce a dispatcher when the FastRouteRequestHandler handles the request.


All versions of router-fastroute with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
psr/http-message Version ^1.0
ellipse/router-adapter Version ^1.0
nikic/fast-route Version ^1.2
ellipse/type-errors 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 ellipse/router-fastroute contains the following files

Loading the files please wait ....