Jenga
, (*1)
PSR-15 middleware stack builder with lazy resolving of middlewares from PSR-11 containers., (*2)
Installation
composer require madewithlove/jenga
Usage
$middleware = [
new RobotsMiddleware(),
RouterMiddleware::class,
];
$stack = new Stack($psrContainer, $middlewares);
$psrResponse = $stack->call($psrServerRequest);
You can also plug in the Stack object into a different PSR-15 middleware chain,
because it implements the MiddlewareInterface., (*3)
$psrResponse = $stack->process($psrServerRequest, $delegate);
Example
You can run an example application, if you have cloned this repository, using:, (*4)
php -S 0.0.0.0:8000 example/index.php
Testing
After cloning this project, install its dependencies and run the test suite:, (*5)
composer install
vendor/bin/phpunit
License
MIT, (*6)