Download the PHP package kento-oka/roust without Composer

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

Roust

CAUTION:
This library has moved to fratily/router. From now on plz use that.

Roust is the fastest (wishful) URI router.

NOTE:
I cant speak engilish. so I used GoogleTranslate.
The exact REDME is in README_origin.

Install

Before using Roust in your project, execute it command in your project:

Usage

First of all, create an instance of router.

Basic usage

Defining route

Routing rules are defined by Router::addRoute().

The first argument is an HTTP method to allow.
The second argument is a URI that matches.
And you can specify additional parameters for the third argument.

You can omit the leading slash in the second argument.

Methods such as Router::get(), Router::post(), Router::put(), and Router::delete() are defined to omit specification of the HTTP method.

Use regex

Use the {id:regex} syntax to embed regular expression. id specifies the parameter name, regex specifies the regular expression to be used in PHP's preg_match().

Even if the same parameter name is specified with the third argument, the value of second argument takes precedence.

Use short regex

For example, if you add a routing rule that matches IP address, there would no one to write that regex in Router::addRoute(). Furthermore, if it is IPv4-mapped IPv6 address, it is useful if it can be converted to IPv4 at the routing stage.

Short regex that makes it possible.

It is short regex that matches only natural numbers and convert to int type:

Short regex can be registered with Router::addShortRegex().

The first argument is an qualified name.
The second argument will pass an instance of the class implementing Roust\ShortRegexInterface.

Group

In the example so far, there were parts common to some rules.

Taking the rule related to the user as an example, the head of URI is neccessarily '/users/' and the value of 'controller' is 'user'.

It is not hard to write common parts with the previous example. But Actually more rules are needed.

In Roust you can summarize the grouping of rules in this way:

Router::makePathGroup() adds value of the first argument to the beginning of the URI of the rule added with Router::addRoute() only while the second argument callback is executed.

In Router::makeParamsGroup(), add parameters. This added parameters can be overwriten with Router::addRoute().

Note

String > Short Regex > Regex


All versions of roust 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 kento-oka/roust contains the following files

Loading the files please wait ....