diff --git a/CHANGELOG.md b/CHANGELOG.md index 20aca1f0..87d5b5c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,107 @@ # Changelog +## 0.8.0 (2017-12-12) + +* Feature / BC break: Add new `Server` facade that buffers and parses incoming + HTTP requests. This provides full PSR-7 compatibility, including support for + form submissions with POST fields and file uploads. + The old `Server` has been renamed to `StreamingServer` for advanced usage + and is used internally. + (#266, #271, #281, #282, #283 and #284 by @WyriHaximus and @clue) + + ```php + // old: handle incomplete/streaming requests + $server = new Server($handler); + + // new: handle complete, buffered and parsed requests + // new: full PSR-7 support, including POST fields and file uploads + $server = new Server($handler); + + // new: handle incomplete/streaming requests + $server = new StreamingServer($handler); + ``` + + > While this is technically a small BC break, this should in fact not break + most consuming code. If you rely on the old request streaming, you can + explicitly use the advanced `StreamingServer` to restore old behavior. + +* Feature: Add support for middleware request handler arrays + (#215, #228, #229, #236, #237, #238, #246, #247, #277, #279 and #285 by @WyriHaximus, @clue and @jsor) + + ```php + // new: middleware request handler arrays + $server = new Server(array( + function (ServerRequestInterface $request, callable $next) { + $request = $request->withHeader('Processed', time()); + return $next($request); + }, + function (ServerRequestInterface $request) { + return new Response(); + } + )); + ``` + +* Feature: Add support for limiting how many next request handlers can be + executed concurrently (`LimitConcurrentRequestsMiddleware`) + (#272 by @clue and @WyriHaximus) + + ```php + // new: explicitly limit concurrency + $server = new Server(array( + new LimitConcurrentRequestsMiddleware(10), + $handler + )); + ``` + +* Feature: Add support for buffering the incoming request body + (`RequestBodyBufferMiddleware`). + This feature mimics PHP's default behavior and respects its `post_max_size` + ini setting by default and allows explicit configuration. + (#216, #224, #263, #276 and #278 by @WyriHaximus and #235 by @andig) + + ```php + // new: buffer up to 10 requests with 8 MiB each + $server = new StreamingServer(array( + new LimitConcurrentRequestsMiddleware(10), + new RequestBodyBufferMiddleware('8M'), + $handler + )); + ``` + +* Feature: Add support for parsing form submissions with POST fields and file + uploads (`RequestBodyParserMiddleware`). + This feature mimics PHP's default behavior and respects its ini settings and + `MAX_FILE_SIZE` POST fields by default and allows explicit configuration. + (#220, #226, #252, #261, #264, #265, #267, #268, #274 by @WyriHaximus and @clue) + + ```php + // new: buffer up to 10 requests with 8 MiB each + // and limit to 4 uploads with 2 MiB each + $server = new StreamingServer(array( + new LimitConcurrentRequestsMiddleware(10), + new RequestBodyBufferMiddleware('8M'), + new RequestBodyParserMiddleware('2M', 4) + $handler + )); + ``` + +* Feature: Update Socket to work around sending secure HTTPS responses with PHP < 7.1.4 + (#244 by @clue) + +* Feature: Support sending same response header multiple times (e.g. `Set-Cookie`) + (#248 by @clue) + +* Feature: Raise maximum request header size to 8k to match common implementations + (#253 by @clue) + +* Improve test suite by adding forward compatibility with PHPUnit 6, test + against PHP 7.1 and PHP 7.2 and refactor and remove risky and duplicate tests. + (#243, #269 and #270 by @carusogabriel and #249 by @clue) + +* Minor code refactoring to move internal classes to `React\Http\Io` namespace + and clean up minor code and documentation issues + (#251 by @clue, #227 by @kalessil, #240 by @christoph-kluge, #230 by @jsor and #280 by @andig) + ## 0.7.4 (2017-08-16) * Improvement: Target evenement 3.0 a long side 2.0 and 1.0 diff --git a/README.md b/README.md index 99d89ec5..9675ba1a 100644 --- a/README.md +++ b/README.md @@ -1068,10 +1068,15 @@ The recommended way to install this library is [through Composer](http://getcomp This will install the latest supported version: ```bash -$ composer require react/http:^0.7.4 +$ composer require react/http:^0.8 ``` -More details about version upgrades can be found in the [CHANGELOG](CHANGELOG.md). +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 7+ and +HHVM. +It's *highly recommended to use PHP 7+* for this project. ## Tests