Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fastdlabs/middleware
FastD Middleware
https://github.com/fastdlabs/middleware
middleware php psr-15
Last synced: 3 months ago
JSON representation
FastD Middleware
- Host: GitHub
- URL: https://github.com/fastdlabs/middleware
- Owner: fastdlabs
- License: mit
- Created: 2016-08-04T09:00:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T09:10:59.000Z (about 1 year ago)
- Last Synced: 2024-04-18T12:10:28.406Z (7 months ago)
- Topics: middleware, php, psr-15
- Language: PHP
- Size: 70.3 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# middleware
[![Build Status](https://travis-ci.org/fastdlabs/middleware.svg?branch=master)](https://travis-ci.org/fastdlabs/middleware)
[![Support PSR15](https://img.shields.io/badge/support-psr15-brightgreen.svg)](https://travis-ci.org/fastdlabs/middleware)
[![Latest Stable Version](https://poser.pugx.org/fastd/middleware/v/stable)](https://packagist.org/packages/fastd/middleware)
[![Total Downloads](https://poser.pugx.org/fastd/middleware/downloads)](https://packagist.org/packages/fastd/middleware)
[![License](https://poser.pugx.org/fastd/middleware/license)](https://packagist.org/packages/fastd/middleware)
[![composer.lock](https://poser.pugx.org/fastd/middleware/composerlock)](https://packagist.org/packages/fastd/middleware)Http 中间件,实现PSR15
### requirement
* php >= 5.6
### installation
```
composer require "fastd/middlware" -vvv
``````php
$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生态的开发者。
如果你乐于此,却又不知如何开始,可以试试下面这些事情:
* 在你的系统中使用,将遇到的问题 [反馈](https://github.com/JanHuang/fastD/issues)。
* 有更好的建议?欢迎联系 [[email protected]](mailto:[email protected]) 或 [新浪微博:编码侠](http://weibo.com/ecbboyjan)。### 联系
如果你在使用中遇到问题,请联系: [[email protected]](mailto:[email protected]). 微博: [编码侠](http://weibo.com/ecbboyjan)
## License MIT