Download the PHP package devlibs/routing without Composer

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

PHP Router

Build Status Coverage Status Latest Stable Version Total Downloads

A fast, flexible and scalable HTTP router for PHP.

Features

Requirements

Install

Documentation

Register handler

Examples

Method Path Handler Matched Unmatched
GET / handler GET / POST / get /
GET|POST /users handler GET /users POST /users
['GET', 'POST'] /merchants handler GET /merchants POST /merchants
GET /users/<username> handler GET /users/foo GET /users/bar
GET /orders/<order_id:\d+> handler GET /orders/123456 GET /orders/letters

It also provides a few shortcuts for registering handler:

Dispatch request

If matched, an RouteInterface will be returns, null otherwise.

Route

Class Route implements RouteInterface, provides some basic methods.

You can also define your own Route class via the following code snippet:

RouteInterface

Route class MUST implements this interface, see RouteInterface for more detail.

Named Params Placeholder

As the examples shown above, Router has ability to detect the param's value of the path.

In general, an placeholder pattern MUST be one of <name> and <name:regex>, it will be converted to ([^/]+) and (regex) respectively. You can also change it via replace the Router::$replacePatterns and Router::$replacements.

Pattern Path Matched Params
/guests/<name> /guests/小明 YES ['name' => '小明']
/guests/<name:\w+> /guests/foo YES ['name' => 'foo']
/guests/<name:\w+> /guests/小明 NO
/orders/<order_id:\d+> /orders/123 YES ['order_id' => '123']
/orders/<order_id:\d+> /orders/letters NO
/posts/<year:\d{4}>/<month:\d{2}>/<title> /posts/2017/10/hello-world YES ['year' => '2017', 'month' => '10', title' => 'hello-world']
/posts/<year:\d{4}>/<month:\d{2}>/<title> /posts/201/10/hello-world NO
/posts/<year:\d{4}>/<month:\d{2}>/<title> /posts/2017/9/hello-world NO
/posts/<year:\d{4}><month:\d{2}>/<title> /posts/201710/hello-world YES ['year' => '2017', 'month' => '10', title' => 'hello-world']

Settings

You can extend Router via settings, such as param's default value and middleware etc, but this topic are out of scope of this document.

Grouping

Grouping is an powerful feature of Router for separating modules or API's versions. And this library also implements this feature, it allows nested grouping.

RESTful API

As the examples shown above, it is obviously easy to design a RESTful API application.

Detect methods

In consideration of OPTIONS request, it provides an API for detecting all valid methods of the specify URI path.

FAQ

Package Not Found

Please add the following repository into repositories when composer complains about that Could not find package devlibs/routing ....


All versions of routing with dependencies

PHP Build Version
Package Version
Requires php Version ^7.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 devlibs/routing contains the following files

Loading the files please wait ....