├── LICENSE ├── README.md ├── composer.json └── src ├── MiddlewareInterface.php └── alias.php /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 PHP Framework Interoperability Group 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HTTP Server Middleware 2 | ====================== 3 | 4 | # Deprecation warning! 5 | 6 | **Starting January 22nd, 2018 http-interop is officially deprecated in favor of 7 | [PSR-15][psr-15].** 8 | 9 | From v1.1, this package directly extends PSR-15 interfaces to provide backwards 10 | compatibility and should no longer be added to new projects. 11 | 12 | Please switch to `psr/http-server-middleware` as soon as possible. 13 | 14 | [psr-15]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md 15 | 16 | ## Version Constraint Warning 17 | 18 | To continue using this package for backwards compatibility, use the following 19 | version constraint to avoid a type error: 20 | 21 | ```json 22 | { 23 | "require": { 24 | "http-interop/http-server-middleware": "^1.1.1" 25 | } 26 | } 27 | ``` 28 | 29 | See [issue #6][issue-6] for details. 30 | 31 | [issue-6]: https://github.com/http-interop/http-server-middleware/issues/6 32 | 33 | ## Changes Required 34 | 35 | There are two changes required to use the official `psr/http-server-middleware` package: 36 | 37 | ### Update Composer 38 | 39 | Replace the line in `composer.json` that reads: 40 | 41 | ```json 42 | { 43 | "require": { 44 | "http-interop/http-server-middleware": "^1.0" 45 | } 46 | } 47 | ``` 48 | 49 | with: 50 | 51 | ```json 52 | { 53 | "require": { 54 | "psr/http-server-middleware": "^1.0" 55 | } 56 | } 57 | ``` 58 | 59 | ### Update Code 60 | 61 | Replace any references to: 62 | 63 | ```php 64 | use Interop\Http\Server\MiddlewareInterface; 65 | ``` 66 | 67 | with: 68 | 69 | ```php 70 | use Psr\Http\Server\MiddlewareInterface; 71 | ``` 72 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "http-interop/http-server-middleware", 3 | "description": "Common interface for HTTP server-side middleware", 4 | "keywords": [ 5 | "psr", 6 | "psr-7", 7 | "psr-15", 8 | "http", 9 | "middleware", 10 | "request", 11 | "response" 12 | ], 13 | "license": "MIT", 14 | "authors": [ 15 | { 16 | "name": "PHP-FIG", 17 | "homepage": "http://www.php-fig.org/" 18 | } 19 | ], 20 | "require": { 21 | "php": ">=7.0", 22 | "psr/http-message": "^1.0", 23 | "psr/http-server-middleware": "^1.0" 24 | }, 25 | "replace": { 26 | "http-interop/http-middleware": ">=0.5" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Interop\\Http\\Server\\": "src/" 31 | }, 32 | "files": [ 33 | "src/alias.php" 34 | ] 35 | }, 36 | "extra": { 37 | "branch-alias": { 38 | "dev-master": "1.0.x-dev" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/MiddlewareInterface.php: -------------------------------------------------------------------------------- 1 |