rosstuck/prosaic

又一个无聊的 PSR-15 中间件调度器

v0.1 2020-08-01 14:30 UTC

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