0.1.0 2017-04-07 14:08 UTC

This package is not auto-updated.

Last update: 2024-09-15 02:19:25 UTC


README

Build Status

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

许可证

MIT