Download the PHP package jameslevi/dispatcher without Composer

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

Dispatcher

Is a simple routing engine for PHP applications.

Features

  1. Supports GET, POST, PUT, PATCH, DELETE and HEAD method.
  2. Enables you to inject event-based callbacks.
  3. Before and after middleware support.
  4. Lightweight and easy to use.

Installation

  1. You can install via composer.

  2. Add the composer autoload mechanism if not using any framework.

Basic Implementation

Request Methods

GET - Retrieve resource representation/information.

POST - Create new resource.

PUT - Update existing resource.

PATCH - Make a partial update on a resource.

DELETE - Delete a resource.

HEAD - Request method identical to GET method but has no body.

Multiple Method Support

Any - Route that can use any request method.

Match - Multiple request method support.

Event Callbacks

Create - Triggered at the beginning of the request.

Before Middleware - Triggered before the middleware handler iteration.

Middleware - Triggered each time a middleware is called.

Middleware Abort - Triggered each time abort is called inside a middleware.

Before Action - Triggered before doing the route action.

After Action - Triggered after doing the route action.

Body Sent - Triggered when the response body was sent.

Destroy - Triggered at the very end of the request.

Error - Triggered each time error occurs.

Route Matched - Triggered if request route matches.

Error Handling

You can set default error callback for all errors.

You can also set callback for each error code.

Before Middlewares

You can implement multiple middlewares before doing the request action.

You can also implement middleware callbacks using classes.

You can now use this class as your middleware.

After Middlewares

You can also implement multiple middlewares after doing the route action.

Actions

This are things you wish to accomplish in each request.

Controllers

Instead of defining all actions in a closure, you may wish to organize everything inside a controller class.

GET Parameters

You can access all the GET parameters using the get method from the request object.

POST, PUT, PATCH, DELETE Parameters

You can use the "post" method from the request object to retrieve POST parameters.

URI Embeded Parameters

You can also use segment of the request URI as a parameter.

Forced Abort

You can immediately terminate the request using "abort" method.

Headers

You can assign headers using the "setHeader" method.

Service Availability

You can down the service availability using the "down" method.

You can also down individual routes.

Request Helpers

Method - Return the request method used during the request.

URI - Return the current request uri excluding the query string.

Port - Return the server port number.

Protocol - Return the server protocol.

Secure - Determine if request is through secure connection.

Localhost - Determine if request is in localhost.

XMLHttpRequest - Determine if request is using XMLHttpRequest.

Contribution

For issues, concerns and suggestions, you can email James Crisostomo via [email protected].

License

This package is an open-sourced software licensed under MIT License.


All versions of dispatcher with dependencies

PHP Build Version
Package Version
Requires jameslevi/objectify Version ^1.0
jameslevi/string 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 jameslevi/dispatcher contains the following files

Loading the files please wait ....