Download the PHP package divineniiquaye/flight-routing without Composer

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

# The PHP HTTP Flight Routing [![PHP Version](https://img.shields.io/packagist/php-v/divineniiquaye/flight-routing.svg?style=flat-square&colorB=%238892BF)](http://php.net) [![Latest Version](https://img.shields.io/packagist/v/divineniiquaye/flight-routing.svg?style=flat-square)](https://packagist.org/packages/divineniiquaye/flight-routing) [![Workflow Status](https://img.shields.io/github/workflow/status/divineniiquaye/flight-routing/build?style=flat-square)](https://github.com/divineniiquaye/flight-routing/actions?query=workflow%3Abuild) [![Code Maintainability](https://img.shields.io/codeclimate/maintainability/divineniiquaye/flight-routing?style=flat-square)](https://codeclimate.com/github/divineniiquaye/flight-routing) [![Coverage Status](https://img.shields.io/codecov/c/github/divineniiquaye/flight-routing?style=flat-square)](https://codecov.io/gh/divineniiquaye/flight-routing) [![Psalm Type Coverage](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Fdivineniiquaye%2Frade-di%2Fcoverage)](https://shepherd.dev/github/divineniiquaye/flight-routing) [![Quality Score](https://img.shields.io/scrutinizer/g/divineniiquaye/flight-routing.svg?style=flat-square)](https://scrutinizer-ci.com/g/divineniiquaye/flight-routing)

Flight routing is yet another high performance HTTP router for PHP. It is simple, easy to use, scalable and fast. This library depends on PSR-7 for route match and support using PSR-15 for intercepting route before being rendered.

This library previous versions was inspired by Sunrise Http Router, Symfony Routing, FastRoute and now completely rewritten for better performance.

🏆 Features

📦 Installation

This project requires PHP 8.0 or higher. The recommended way to install, is via Composer. Simply run:

I recommend reading my blog post on setting up Apache, Nginx, IIS server configuration for your PHP project.

📍 Quick Start

The default compiler accepts the following constraints in route pattern:

A name of a placeholder variable is simply an acceptable PHP function/method parameter name expected to be unique, while the regex definition and default value can be any string (i.e [^/]+).

Route pattern accepts beginning with a //domain.com or https://domain.com. Route path also support adding controller (i.e *<controller@handler>) directly at the end of the route path:

Here is an example of how to use the library:

Incase you'll prefer declaring your routes outside a closure scope, try this example:

NB: If caching is enabled, using the router's setCollection() method has much higher performance than using the withCollection() method.

By default Flight routing does not ship a PSR-7 http library nor a library to send response headers and body to the browser. If you'll like to install this libraries, I recommend installing either biurad/http-galaxy or nyholm/psr7 and laminas/laminas-httphandlerrunner.

In this example below, I'll assume you've installed nyholm/psr-7 and laminas/laminas-httphandlerrunner, So we can use PSR-15 to intercept route before matching and PSR-17 to render route response onto the browser:

To use PHP 8 attribute support, I highly recommend installing biurad/annotations and if for some reason you decide to use doctrine/annotations I recommend you install spiral/attributes to use either one or both.

An example using annotations/attribute is:

You can add more listeners to the annotation loader class to have all your annotations/attributes loaded from one place. Also use either the populate() route collection method or group() to merge annotation's route collection into default route collection, or just simple use the annotation's route collection as your default router route collection.

Finally, use a restful route, refer to this example below, using Flight\Routing\RouteCollection::resource, method means, route becomes available for all standard request methods Flight\Routing\Router::HTTP_METHODS_STANDARD:

Add route using Flight\Routing\Handlers\ResourceHandler:

As of Version 2.0, flight routing is very much stable and can be used in production, Feel free to contribute to the project, report bugs, request features and so on.

Kindly take note of these before using:

  • Avoid declaring the same pattern of dynamic route multiple times (eg. /hello/{name}), instead use static paths if you choose use same route path with multiple configurations.
  • Route handlers prefixed with a \ (eg. \HelloClass or ['\HelloClass', 'handle']) should be avoided if you choose to use a different resolver other the default handler's RouteInvoker class.
  • If you decide again to use a custom route's handler resolver, I recommend you include the static resolveRoute method from the default's route's RouteInvoker class.

📓 Documentation

In-depth documentation on how to use this library, kindly check out the documentation for this library. It is also recommended to browse through unit tests in the tests directory.

🙌 Sponsors

If this library made it into your project, or you interested in supporting us, please consider donating to support future development.

👥 Credits & Acknowledgements

📄 License

Flight Routing is completely free and released under the BSD 3 License.


All versions of flight-routing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/http-factory Version ^1.0
laminas/laminas-stratigility Version ^3.2
symfony/polyfill-php81 Version ^1.23
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 divineniiquaye/flight-routing contains the following files

Loading the files please wait ....