jralph / server-middleware
A middleware dispatcher supporting psr15.
1.0.0
2018-09-27 16:06 UTC
Requires
- php: ~7.1
- guzzlehttp/psr7: ^1.4
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- php-coveralls/php-coveralls: 2.1.0
- phpunit/phpunit: ~6.0
Provides
This package is auto-updated.
Last update: 2024-11-08 10:28:32 UTC
README
A PSR-15 compliant server middleware dispatcher implementation.
Goal
The goal of this package is to implement the (currently in draft) PSR-15 spec for middleware in as simple a way as possible.
The entire package MUST be covered by tests.
Usage
See PSR-15 spec for more detailed info on implementing middleware.
<?php use JRalph\ServerMiddleware\Dispatcher; $dispatcher = (new Dispatcher()) ->addMiddleware( /** * Implementations of Psr\Http\Server\MiddlewareInterface */ $firstMiddleware, $secondMiddleware, $thirdMiddleware ); /** @var \Psr\Http\Message\ServerRequestInterface $request */ $request = new Request; $response = $dispatcher->handle($request);