rosstuck / prosaic
又一个无聊的 PSR-15 中间件调度器
v0.1
2020-08-01 14:30 UTC
Requires
- php: >=7.4
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- doctrine/coding-standard: ^8.1
- laminas/laminas-diactoros: ^2.3
- phpstan/phpstan: ^0.12.33
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2024-09-09 05:26:15 UTC
README
一个无聊的 PSR-15 中间件调度器
Prosaic 可以通过 PSR-15 中间件管道运行你的 PSR-7 请求。没有花哨的构建方法、路由或 DI 容器集成,它仅仅是一个中间件管道。仅此而已。
安装
composer require rosstuck/prosaic
示例
您可以如此设置您的中间件管道
<?php $dispatcher = new Prosaic\HttpDispatcher( new FirstMiddleware(), new SecondMiddleware(), new ThirdMiddleware() ); $response = $dispatcher->dispatch($request);
测试
composer test