Download the PHP package silawrenc/traffic without Composer

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

Traffic

High five

Master branch build status PHP ~7.0 Published version

Traffic is lightweight, but fast and flexible php web routing component. Routes are defined as regular expressions and are dispatched to a stack of callable handlers.

The easiest way to install Traffic is via Composer.

API

Adding routes

Routes can be added to the router in the format ($method, $pattern, ...$handlers) as follows.

There are also convenience methods for GET and POST requests.

Dynamic routes

You can specify both the method and path as regular expressions. Captures are passed as positional arguments to handlers.

A simpler syntax is also supported: you can use /foo/{bar} to capture part of a url (or method). The default is to match any characters except /. If you want to specify a pattern you can include it after a colon, e.g. /foo/{bar:\d{4}}. The wildcard * is supported for methods, and will match and capture any method name.

The best way to get a handle on supported formats is to have a look at failing test cases. Anything that is a valid regular expression is a valid syntax for either method or path.

Handlers

You can specify as many handlers as you like, and they will be called in the order they are specified. If any handler returns strictly false, none of the handlers after it are invoked.

Routing

Once you've added all your routes, you can use the router for matching with:

This will match $method and $path against all of the routes you've added, and invoke the handlers of the first match. So be sure to specify your routes from most to least specific. The return value of the route method is true if a match is found, and false if not.


All versions of traffic with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.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 silawrenc/traffic contains the following files

Loading the files please wait ....