alexpts / psr15-middleware-manager
Middleware manager compatible with the PSR-7 and PSR-15
1.2.0
2018-08-17 16:33 UTC
Requires
- php: ~7.2
- psr/http-message: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpunit/phpunit: ^7.3
- zendframework/zend-diactoros: ^1.8
README
Middleware manager compatible with the PSR-7 and PSR-15
Installation
$ composer require alexpts/psr15-middleware-manager
Example
use PTS\PSR15\MiddlewareManager\MiddlewareManager; $manager = new MiddlewareManager; $manager ->use($logMiddleware, '/admins/.*') // invoke only path /admins/.* ->use(new RequestWithAttribute(['container' => $container])) ->use(new RouterMiddleware); $manager->handle($request);