madewithlove / jenga
0.1.0
2017-04-07 14:08 UTC
Requires
- php: >5.6
- psr/container: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- league/container: ^2.4
- league/route: ^3.0
- phpunit/phpunit: ^5.7
- zendframework/zend-diactoros: ^1.3
This package is not auto-updated.
Last update: 2024-09-15 02:19:25 UTC
README
PSR-15 中间件堆栈构建器,具有从 PSR-11 容器中懒加载中间件的功能。
安装
composer require madewithlove/jenga
使用方法
$middleware = [ new RobotsMiddleware(), RouterMiddleware::class, ]; $stack = new Stack($psrContainer, $middlewares); $psrResponse = $stack->call($psrServerRequest);
您还可以将 Stack
对象插入到不同的 PSR-15 中间件链中,因为该对象实现了 MiddlewareInterface 接口。
$psrResponse = $stack->process($psrServerRequest, $delegate);
示例
如果您已克隆此存储库,可以使用以下命令运行示例应用程序:
php -S 0.0.0.0:8000 example/index.php
测试
克隆此项目后,安装其依赖项并运行测试套件。
composer install vendor/bin/phpunit