Download the PHP
package crodas/dispatcher without Composer
On this page you can find all versions of the php package
crodas/dispatcher. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor crodas Package dispatcher Short Description Dispatcher generator License
BSD-4-Clause
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.
Dispatcher is a routing library that maps URLs to actions.
Installing
You can install using composer:
Defining routes
Routes are defined using annotations for methods or functions.
Dispatcher walks over the filesystem looking for @Route annotations on functions and methods.
How to use it
By default, it runs in production mode and it won't rebuild the routes on changes. If you wish to run on development mode, you should do this:
Filters
To simply things, Dispatcher doesn't allow you yet to define regular expressions to validate your placeholders. Instead it lets you to define functions which validates and modified the values of your placeholders.
The filter should return a false if $value is not valid the router will jump to the next rule or will throw a notfound exception. $name is used because one callback can be used as multiple filters.
Expensive Filters can be cached with @Cache <ttl> annotation. The cache mechanism is defined in the application with a class which implements FilterCache interface.
Valid Patterns
/foo/bar
/foo/{user}
/foo/{user:user1}/{user:user2}: Inside the Request object the user objects will be named user1 and user2 to avoid name collisions.
/foo/{user:u1}-vs-{user:u2}.{ext}: We can have multiple variables inside one single directory level as long as they are separated by constants.
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 crodas/dispatcher contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.