techworker/middleware
Composer 安装命令:
composer require techworker/middleware
包简介
PSR-7 middleware function for building and dispatching middlewares.
README 文档
README
This library provides a single function to implement a PHP 7 middleware workflow for your PHP applications.
It is heavily inspired from the relay php implementation by Paul M. Jones
Usage
Import the function and define a list of middlewares.
<?php use Psr7Middlewares\Middleware; use Psr7Middlewares\Middleware\ErrorHandler; use function Techworker\Functional\middleware; /** * This function checks whether the 'Authorization' is given. */ $middleware1 = function( \Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, callable $next ) { return $next($request, $response); }; $middlewares = [$middleware1, \Psr7Middlewares\Middleware::uuid()]; middleware($request, $response, $middlewares);
Installation
Add this to your composer.json
"require": { "techworker/middleware": "^1.0" }
.. or use the following command on your command line:
composer require techworker/middleware
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-04