fastd/middleware

v1.2.3 2018-01-23 10:10 UTC

README

Build Status Support PSR15 Latest Stable Version Total Downloads License composer.lock

Http 中间件,实现PSR15

requirement

  • php >= 5.6

installation

composer require "fastd/middlware" -vvv
$middleware = new Middleware(function (RequestInterface $request, DelegateInterface $next) {
    // delegate control to next middleware
    return $next($request);
});

$middleware2 = new Middleware(function (RequestInterface $request, DelegateInterface $next) {
    echo 'world';
});

$dispatcher = new Dispatcher([
    $middleware,
    $middleware2
]);

$response = $dispatcher->dispatch(new ServerRequest('GET', '/'));

贡献

非常欢迎感兴趣,愿意参与其中,共同打造更好PHP生态,Swoole生态的开发者。

如果你乐于此,却又不知如何开始,可以试试下面这些事情:

联系

如果你在使用中遇到问题,请联系: bboyjanhuang@gmail.com. 微博: 编码侠

License MIT