Download the PHP package ellipse/handlers-controller without Composer

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

Request handler controller

This package provides a Psr-15 request handler proxying a class method using a Psr-11 container.

Require php >= 7.0

Installation composer require ellipse/handlers-controller

Run tests ./vendor/bin/kahlan

Using controllers as request handlers

The class Ellipse\Handlers\ControllerRequestHandler takes an implementation of Psr\Container\ContainerInterface, a container id, a method name and an optional array of request attribute names as parameters. Its ->handle() method retrieve an instance of the controller class from the container and call its method with the given name in order to return a response.

The controller method is executed by using the container to retrieve values for its type hinted parameters. Request attribute values matching the given request attribute names are used for the non-type hinted parameters, in the order they are listed.

Also when the controller method has a parameter type hinted as Psr\Http\Message\ServerRequestInterface, the actual Psr-7 request received by the request handler is used. It means when a middleware create a new request (since Psr-7 requests are immutable) the controller method receive this new request.

An Ellipse\Handlers\Exceptions\ContainedControllerTypeException is thrown when the controller retrieved from the container is not an object.

Example using auto wiring

It can be cumbersome to register every controller classes in the container. Here is how to auto wire controller instances using the Ellipse\Container\ReflectionContainer class from the ellipse/container-reflection package.


All versions of handlers-controller with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
psr/http-message Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/container Version ^1.0
ellipse/container-overridden Version ^1.0
ellipse/resolvable-callable Version ^1.0
ellipse/type-errors 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 ellipse/handlers-controller contains the following files

Loading the files please wait ....