From 24fa405ce97a6df565fddeefd3c9f49c9e7bd884 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 5 Aug 2021 10:34:55 +0200 Subject: [PATCH] Add laminas/laminas-httphandlerrunner to composer dependencies --- .../files/lib/system/api/composer.json | 3 +- .../files/lib/system/api/composer.lock | 132 ++++++++++++++++- .../system/api/composer/autoload_classmap.php | 11 ++ .../system/api/composer/autoload_files.php | 8 +- .../lib/system/api/composer/autoload_psr4.php | 2 + .../system/api/composer/autoload_static.php | 29 +++- .../lib/system/api/composer/installed.json | 136 ++++++++++++++++++ .../lib/system/api/composer/installed.php | 24 ++++ .../laminas-httphandlerrunner/CHANGELOG.md | 135 +++++++++++++++++ .../laminas-httphandlerrunner/COPYRIGHT.md | 1 + .../laminas-httphandlerrunner/LICENSE.md | 26 ++++ .../laminas-httphandlerrunner/README.md | 33 +++++ .../laminas-httphandlerrunner/composer.json | 71 +++++++++ .../src/ConfigProvider.php | 25 ++++ .../src/Emitter/EmitterInterface.php | 35 +++++ .../src/Emitter/EmitterStack.php | 100 +++++++++++++ .../src/Emitter/SapiEmitter.php | 43 ++++++ .../src/Emitter/SapiEmitterTrait.php | 102 +++++++++++++ .../src/Emitter/SapiStreamEmitter.php | 135 +++++++++++++++++ .../src/Exception/EmitterException.php | 26 ++++ .../src/Exception/ExceptionInterface.php | 18 +++ .../src/Exception/InvalidEmitterException.php | 35 +++++ .../src/RequestHandlerRunner.php | 106 ++++++++++++++ .../api/psr/http-server-handler/LICENSE | 21 +++ .../api/psr/http-server-handler/README.md | 6 + .../api/psr/http-server-handler/composer.json | 36 +++++ .../src/RequestHandlerInterface.php | 22 +++ 27 files changed, 1311 insertions(+), 10 deletions(-) create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/CHANGELOG.md create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/COPYRIGHT.md create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/LICENSE.md create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/README.md create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/composer.json create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/ConfigProvider.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/EmitterInterface.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiStreamEmitter.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Exception/ExceptionInterface.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Exception/InvalidEmitterException.php create mode 100644 wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php create mode 100644 wcfsetup/install/files/lib/system/api/psr/http-server-handler/LICENSE create mode 100644 wcfsetup/install/files/lib/system/api/psr/http-server-handler/README.md create mode 100644 wcfsetup/install/files/lib/system/api/psr/http-server-handler/composer.json create mode 100644 wcfsetup/install/files/lib/system/api/psr/http-server-handler/src/RequestHandlerInterface.php diff --git a/wcfsetup/install/files/lib/system/api/composer.json b/wcfsetup/install/files/lib/system/api/composer.json index 812400065a..fc774967d0 100644 --- a/wcfsetup/install/files/lib/system/api/composer.json +++ b/wcfsetup/install/files/lib/system/api/composer.json @@ -18,6 +18,7 @@ "scssphp/scssphp": "^1.4", "guzzlehttp/guzzle": "^7.3.0", "paragonie/constant_time_encoding": "^2.3", - "laminas/laminas-diactoros": "^2.4" + "laminas/laminas-diactoros": "^2.4", + "laminas/laminas-httphandlerrunner": "^1.2" } } diff --git a/wcfsetup/install/files/lib/system/api/composer.lock b/wcfsetup/install/files/lib/system/api/composer.lock index 02440899d6..d24293223c 100644 --- a/wcfsetup/install/files/lib/system/api/composer.lock +++ b/wcfsetup/install/files/lib/system/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b828e29250a7fa9ea0b3fca22bca6864", + "content-hash": "b3aeea343e2f7ee79bb2d9a6b8a86799", "packages": [ { "name": "chrisjean/php-ico", @@ -494,6 +494,79 @@ ], "time": "2020-09-03T14:29:41+00:00" }, + { + "name": "laminas/laminas-httphandlerrunner", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-httphandlerrunner.git", + "reference": "e1a5dad040e0043135e8095ee27d1fbf6fb640e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/e1a5dad040e0043135e8095ee27d1fbf6fb640e1", + "reference": "e1a5dad040e0043135e8095ee27d1fbf6fb640e1", + "shasum": "" + }, + "require": { + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.1", + "psr/http-message": "^1.0", + "psr/http-message-implementation": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "replace": { + "zendframework/zend-httphandlerrunner": "^1.1.0" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-diactoros": "^1.7 || ^2.1.1", + "phpunit/phpunit": "^7.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" + }, + "laminas": { + "config-provider": "Laminas\\HttpHandlerRunner\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Laminas\\HttpHandlerRunner\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", + "homepage": "https://laminas.dev", + "keywords": [ + "components", + "laminas", + "mezzio", + "psr-15", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-httphandlerrunner/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-httphandlerrunner/issues", + "rss": "https://github.com/laminas/laminas-httphandlerrunner/releases.atom", + "source": "https://github.com/laminas/laminas-httphandlerrunner" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-06-03T15:52:17+00:00" + }, { "name": "laminas/laminas-zendframework-bridge", "version": "1.1.1", @@ -970,6 +1043,63 @@ }, "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/http-server-handler", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "support": { + "issues": "https://github.com/php-fig/http-server-handler/issues", + "source": "https://github.com/php-fig/http-server-handler/tree/master" + }, + "time": "2018-10-30T16:46:14+00:00" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php b/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php index d78fd466a8..78fba2bc61 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_classmap.php @@ -366,6 +366,16 @@ return array( 'Laminas\\Diactoros\\UploadedFileFactory' => $vendorDir . '/laminas/laminas-diactoros/src/UploadedFileFactory.php', 'Laminas\\Diactoros\\Uri' => $vendorDir . '/laminas/laminas-diactoros/src/Uri.php', 'Laminas\\Diactoros\\UriFactory' => $vendorDir . '/laminas/laminas-diactoros/src/UriFactory.php', + 'Laminas\\HttpHandlerRunner\\ConfigProvider' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/ConfigProvider.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\EmitterInterface' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Emitter/EmitterInterface.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\EmitterStack' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitter' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitterTrait' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\SapiStreamEmitter' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Emitter/SapiStreamEmitter.php', + 'Laminas\\HttpHandlerRunner\\Exception\\EmitterException' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php', + 'Laminas\\HttpHandlerRunner\\Exception\\ExceptionInterface' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Exception/ExceptionInterface.php', + 'Laminas\\HttpHandlerRunner\\Exception\\InvalidEmitterException' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/Exception/InvalidEmitterException.php', + 'Laminas\\HttpHandlerRunner\\RequestHandlerRunner' => $vendorDir . '/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php', 'Laminas\\ZendFrameworkBridge\\Autoloader' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/Autoloader.php', 'Laminas\\ZendFrameworkBridge\\ConfigPostProcessor' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/ConfigPostProcessor.php', 'Laminas\\ZendFrameworkBridge\\Module' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/Module.php', @@ -412,6 +422,7 @@ return array( 'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php', 'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php', 'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php', + 'Psr\\Http\\Server\\RequestHandlerInterface' => $vendorDir . '/psr/http-server-handler/src/RequestHandlerInterface.php', 'ScssPhp\\ScssPhp\\Base\\Range' => $vendorDir . '/scssphp/scssphp/src/Base/Range.php', 'ScssPhp\\ScssPhp\\Block' => $vendorDir . '/scssphp/scssphp/src/Block.php', 'ScssPhp\\ScssPhp\\Cache' => $vendorDir . '/scssphp/scssphp/src/Cache.php', diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_files.php b/wcfsetup/install/files/lib/system/api/composer/autoload_files.php index b3b9342a53..d7935d7919 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_files.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_files.php @@ -6,12 +6,9 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = $vendorDir; return array( + '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', - '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -28,4 +25,7 @@ return array( 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', ); diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_psr4.php b/wcfsetup/install/files/lib/system/api/composer/autoload_psr4.php index 2262fd9d6d..6af3227e6d 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_psr4.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_psr4.php @@ -10,11 +10,13 @@ return array( 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), + 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Pelago\\Emogrifier\\' => array($vendorDir . '/pelago/emogrifier/src'), 'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'), 'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'), + 'Laminas\\HttpHandlerRunner\\' => array($vendorDir . '/laminas/laminas-httphandlerrunner/src'), 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), diff --git a/wcfsetup/install/files/lib/system/api/composer/autoload_static.php b/wcfsetup/install/files/lib/system/api/composer/autoload_static.php index 38c0399af3..021008b4de 100644 --- a/wcfsetup/install/files/lib/system/api/composer/autoload_static.php +++ b/wcfsetup/install/files/lib/system/api/composer/autoload_static.php @@ -7,12 +7,9 @@ namespace Composer\Autoload; class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d { public static $files = array ( + '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', - '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -29,6 +26,9 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', ); public static $prefixLengthsPsr4 = array ( @@ -44,6 +44,7 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d ), 'P' => array ( + 'Psr\\Http\\Server\\' => 16, 'Psr\\Http\\Message\\' => 17, 'Psr\\Http\\Client\\' => 16, 'Pelago\\Emogrifier\\' => 18, @@ -52,6 +53,7 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d 'L' => array ( 'Laminas\\ZendFrameworkBridge\\' => 28, + 'Laminas\\HttpHandlerRunner\\' => 26, 'Laminas\\Diactoros\\' => 18, ), 'G' => @@ -79,6 +81,10 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d array ( 0 => __DIR__ . '/..' . '/scssphp/scssphp/src', ), + 'Psr\\Http\\Server\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-server-handler/src', + ), 'Psr\\Http\\Message\\' => array ( 0 => __DIR__ . '/..' . '/psr/http-factory/src', @@ -100,6 +106,10 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d array ( 0 => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src', ), + 'Laminas\\HttpHandlerRunner\\' => + array ( + 0 => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src', + ), 'Laminas\\Diactoros\\' => array ( 0 => __DIR__ . '/..' . '/laminas/laminas-diactoros/src', @@ -503,6 +513,16 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d 'Laminas\\Diactoros\\UploadedFileFactory' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/UploadedFileFactory.php', 'Laminas\\Diactoros\\Uri' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/Uri.php', 'Laminas\\Diactoros\\UriFactory' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/UriFactory.php', + 'Laminas\\HttpHandlerRunner\\ConfigProvider' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/ConfigProvider.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\EmitterInterface' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Emitter/EmitterInterface.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\EmitterStack' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitter' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitterTrait' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php', + 'Laminas\\HttpHandlerRunner\\Emitter\\SapiStreamEmitter' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Emitter/SapiStreamEmitter.php', + 'Laminas\\HttpHandlerRunner\\Exception\\EmitterException' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php', + 'Laminas\\HttpHandlerRunner\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Exception/ExceptionInterface.php', + 'Laminas\\HttpHandlerRunner\\Exception\\InvalidEmitterException' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/Exception/InvalidEmitterException.php', + 'Laminas\\HttpHandlerRunner\\RequestHandlerRunner' => __DIR__ . '/..' . '/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php', 'Laminas\\ZendFrameworkBridge\\Autoloader' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/Autoloader.php', 'Laminas\\ZendFrameworkBridge\\ConfigPostProcessor' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/ConfigPostProcessor.php', 'Laminas\\ZendFrameworkBridge\\Module' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/Module.php', @@ -549,6 +569,7 @@ class ComposerStaticInita1f5f7c74275d47a45049a2936db1d0d 'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php', 'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php', 'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php', + 'Psr\\Http\\Server\\RequestHandlerInterface' => __DIR__ . '/..' . '/psr/http-server-handler/src/RequestHandlerInterface.php', 'ScssPhp\\ScssPhp\\Base\\Range' => __DIR__ . '/..' . '/scssphp/scssphp/src/Base/Range.php', 'ScssPhp\\ScssPhp\\Block' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block.php', 'ScssPhp\\ScssPhp\\Cache' => __DIR__ . '/..' . '/scssphp/scssphp/src/Cache.php', diff --git a/wcfsetup/install/files/lib/system/api/composer/installed.json b/wcfsetup/install/files/lib/system/api/composer/installed.json index a168227410..c57a665e41 100644 --- a/wcfsetup/install/files/lib/system/api/composer/installed.json +++ b/wcfsetup/install/files/lib/system/api/composer/installed.json @@ -497,6 +497,82 @@ ], "install-path": "../laminas/laminas-diactoros" }, + { + "name": "laminas/laminas-httphandlerrunner", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-httphandlerrunner.git", + "reference": "e1a5dad040e0043135e8095ee27d1fbf6fb640e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/e1a5dad040e0043135e8095ee27d1fbf6fb640e1", + "reference": "e1a5dad040e0043135e8095ee27d1fbf6fb640e1", + "shasum": "" + }, + "require": { + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.1", + "psr/http-message": "^1.0", + "psr/http-message-implementation": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "replace": { + "zendframework/zend-httphandlerrunner": "^1.1.0" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-diactoros": "^1.7 || ^2.1.1", + "phpunit/phpunit": "^7.0.2" + }, + "time": "2020-06-03T15:52:17+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" + }, + "laminas": { + "config-provider": "Laminas\\HttpHandlerRunner\\ConfigProvider" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Laminas\\HttpHandlerRunner\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", + "homepage": "https://laminas.dev", + "keywords": [ + "components", + "laminas", + "mezzio", + "psr-15", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-httphandlerrunner/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-httphandlerrunner/issues", + "rss": "https://github.com/laminas/laminas-httphandlerrunner/releases.atom", + "source": "https://github.com/laminas/laminas-httphandlerrunner" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "install-path": "../laminas/laminas-httphandlerrunner" + }, { "name": "laminas/laminas-zendframework-bridge", "version": "1.1.1", @@ -987,6 +1063,66 @@ ], "install-path": "../psr/http-message" }, + { + "name": "psr/http-server-handler", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "time": "2018-10-30T16:46:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "support": { + "issues": "https://github.com/php-fig/http-server-handler/issues", + "source": "https://github.com/php-fig/http-server-handler/tree/master" + }, + "install-path": "../psr/http-server-handler" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", diff --git a/wcfsetup/install/files/lib/system/api/composer/installed.php b/wcfsetup/install/files/lib/system/api/composer/installed.php index 53a59d97db..dd62df17d9 100644 --- a/wcfsetup/install/files/lib/system/api/composer/installed.php +++ b/wcfsetup/install/files/lib/system/api/composer/installed.php @@ -82,6 +82,15 @@ 'reference' => '36ef09b73e884135d2059cc498c938e90821bb57', 'dev_requirement' => false, ), + 'laminas/laminas-httphandlerrunner' => array( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../laminas/laminas-httphandlerrunner', + 'aliases' => array(), + 'reference' => 'e1a5dad040e0043135e8095ee27d1fbf6fb640e1', + 'dev_requirement' => false, + ), 'laminas/laminas-zendframework-bridge' => array( 'pretty_version' => '1.1.1', 'version' => '1.1.1.0', @@ -172,6 +181,15 @@ 0 => '1.0', ), ), + 'psr/http-server-handler' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-server-handler', + 'aliases' => array(), + 'reference' => 'aff2f80e33b7f026ec96bb42f63242dc50ffcae7', + 'dev_requirement' => false, + ), 'ralouphie/getallheaders' => array( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', @@ -223,5 +241,11 @@ 0 => '^2.2.1', ), ), + 'zendframework/zend-httphandlerrunner' => array( + 'dev_requirement' => false, + 'replaced' => array( + 0 => '^1.1.0', + ), + ), ), ); diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/CHANGELOG.md b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/CHANGELOG.md new file mode 100644 index 0000000000..38a8dfd349 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/CHANGELOG.md @@ -0,0 +1,135 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.2.0 - 2020-06-03 + +### Added + +- Nothing. + +### Changed + +- [#4](https://github.com/laminas/laminas-httphandlerrunner/pull/4) adds a call to `flush()` within the `SapiStreamEmitter`, after emitting headers and the status line, but before emitting content. This change allows providing a response to the browser more quickly, allowing it to process the stream as it is pushed. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 1.1.0 - 2019-02-19 + +### Added + +- [zendframework/zend-httphandlerrunner#10](https://github.com/zendframework/zend-httphandlerrunner/pull/10) adds support for laminas-diactoros v2 releases. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 1.0.2 - 2019-02-19 + +### Added + +- [zendframework/zend-httphandlerrunner#9](https://github.com/zendframework/zend-httphandlerrunner/pull/9) adds support for PHP 7.3. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 1.0.1 - 2018-02-21 + +### Added + +- Nothing. + +### Changed + +- [zendframework/zend-httphandlerrunner#2](https://github.com/zendframework/zend-httphandlerrunner/pull/2) modifies + how the request and error response factories are composed with the + `RequestHandlerRunner` class. In both cases, they are now encapsulated in a + closure which also defines a return type hint, ensuring that if the factories + produce an invalid return type, a PHP `TypeError` will be raised. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + +## 1.0.0 - 2018-02-05 + +Initial stable release. + +The `Laminas\HttpRequestHandler\Emitter` subcomponent was originally released as +part of two packages: + +- `EmitterInterface` and the two SAPI emitter implementations were released + previously as part of the [laminas-diactoros](https://docs.laminas.dev/laminas-daictoros) + package. + +- `EmitterStack` was previously released as part of the + [mezzio](https://docs.mezzio.dev/mezzio/) package. + +These features are mostly verbatim from that package, with minor API changes. + +The `RequestHandlerRunner` was originally developed as part of version 3 +development of mezzio, but extracted here for general use with +[PSR-15](https://www.php-fig.org/psr/psr-15) applications. + +### Added + +- Everything. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/COPYRIGHT.md b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/COPYRIGHT.md new file mode 100644 index 0000000000..0a8cccc06b --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/COPYRIGHT.md @@ -0,0 +1 @@ +Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. (https://getlaminas.org/) diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/LICENSE.md b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/LICENSE.md new file mode 100644 index 0000000000..10b40f1423 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/LICENSE.md @@ -0,0 +1,26 @@ +Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +- Neither the name of Laminas Foundation nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/README.md b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/README.md new file mode 100644 index 0000000000..3fcda6f932 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/README.md @@ -0,0 +1,33 @@ +# laminas-httphandlerrunner + +[![Build Status](https://travis-ci.com/laminas/laminas-httphandlerrunner.svg?branch=master)](https://travis-ci.com/laminas/laminas-httphandlerrunner) +[![Coverage Status](https://coveralls.io/repos/github/laminas/laminas-httphandlerrunner/badge.svg?branch=master)](https://coveralls.io/github/laminas/laminas-httphandlerrunner?branch=master) + +This library provides utilities for: + +- Emitting [PSR-7](https://www.php-fig.org/psr/psr-7) responses. +- Running [PSR-15](https://www.php-fig.org/psr/psr-15) server request handlers, + which involves marshaling a PSR-7 `ServerRequestInterface`, handling + exceptions due to request creation, and emitting the response returned by the + composed request handler. + +The `RequestHandlerRunner` will be used in the bootstrap of your application to +fire off the `RequestHandlerInterface` representing your application. + +## Installation + +Run the following to install this library: + +```bash +$ composer require laminas/laminas-httphandlerrunner +``` + +## Documentation + +Documentation is [in the doc tree](docs/book/), and can be compiled using [mkdocs](https://www.mkdocs.org): + +```bash +$ mkdocs build +``` + +You may also [browse the documentation online](https://docs.laminas.dev/laminas-httphandlerrunner/). diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/composer.json b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/composer.json new file mode 100644 index 0000000000..7acc0a5180 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/composer.json @@ -0,0 +1,71 @@ +{ + "name": "laminas/laminas-httphandlerrunner", + "description": "Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.", + "license": "BSD-3-Clause", + "keywords": [ + "laminas", + "components", + "mezzio", + "psr-7", + "psr-15" + ], + "homepage": "https://laminas.dev", + "support": { + "docs": "https://docs.laminas.dev/laminas-httphandlerrunner/", + "issues": "https://github.com/laminas/laminas-httphandlerrunner/issues", + "source": "https://github.com/laminas/laminas-httphandlerrunner", + "rss": "https://github.com/laminas/laminas-httphandlerrunner/releases.atom", + "chat": "https://laminas.dev/chat", + "forum": "https://discourse.laminas.dev" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" + }, + "laminas": { + "config-provider": "Laminas\\HttpHandlerRunner\\ConfigProvider" + } + }, + "require": { + "php": "^7.1", + "laminas/laminas-zendframework-bridge": "^1.0", + "psr/http-message": "^1.0", + "psr/http-message-implementation": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-diactoros": "^1.7 || ^2.1.1", + "phpunit/phpunit": "^7.0.2" + }, + "autoload": { + "psr-4": { + "Laminas\\HttpHandlerRunner\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "LaminasTest\\HttpHandlerRunner\\": "test/" + }, + "files": [ + "test/TestAsset/SapiResponse.php" + ] + }, + "scripts": { + "check": [ + "@cs-check", + "@test" + ], + "cs-check": "phpcs", + "cs-fix": "phpcbf", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" + }, + "replace": { + "zendframework/zend-httphandlerrunner": "^1.1.0" + } +} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/ConfigProvider.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/ConfigProvider.php new file mode 100644 index 0000000000..3a21140f7a --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/ConfigProvider.php @@ -0,0 +1,25 @@ + $this->getDependencies(), + ]; + } + + public function getDependencies() : array + { + return [ + ]; + } +} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/EmitterInterface.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/EmitterInterface.php new file mode 100644 index 0000000000..f4a49b8ba6 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/EmitterInterface.php @@ -0,0 +1,35 @@ +emit($response)) { + return true; + } + } + + return false; + } + + /** + * Set an emitter on the stack by index. + * + * @param mixed $index + * @param EmitterInterface $emitter + * @return void + * @throws InvalidArgumentException if not an EmitterInterface instance + */ + public function offsetSet($index, $emitter) + { + $this->validateEmitter($emitter); + parent::offsetSet($index, $emitter); + } + + /** + * Push an emitter to the stack. + * + * @param EmitterInterface $emitter + * @return void + * @throws InvalidArgumentException if not an EmitterInterface instance + */ + public function push($emitter) + { + $this->validateEmitter($emitter); + parent::push($emitter); + } + + /** + * Unshift an emitter to the stack. + * + * @param EmitterInterface $emitter + * @return void + * @throws InvalidArgumentException if not an EmitterInterface instance + */ + public function unshift($emitter) + { + $this->validateEmitter($emitter); + parent::unshift($emitter); + } + + /** + * Validate that an emitter implements EmitterInterface. + * + * @param mixed $emitter + * @throws Exception\InvalidEmitterException for non-emitter instances + */ + private function validateEmitter($emitter) : void + { + if (! $emitter instanceof EmitterInterface) { + throw Exception\InvalidEmitterException::forEmitter($emitter); + } + } +} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php new file mode 100644 index 0000000000..5281473e62 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php @@ -0,0 +1,43 @@ +assertNoPreviousOutput(); + + $this->emitHeaders($response); + $this->emitStatusLine($response); + $this->emitBody($response); + + return true; + } + + /** + * Emit the message body. + */ + private function emitBody(ResponseInterface $response) : void + { + echo $response->getBody(); + } +} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php new file mode 100644 index 0000000000..d09c3a2db5 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php @@ -0,0 +1,102 @@ + 0 && ob_get_length() > 0) { + throw EmitterException::forOutputSent(); + } + } + + /** + * Emit the status line. + * + * Emits the status line using the protocol version and status code from + * the response; if a reason phrase is available, it, too, is emitted. + * + * It is important to mention that this method should be called after + * `emitHeaders()` in order to prevent PHP from changing the status code of + * the emitted response. + * + * @see \Laminas\HttpHandlerRunner\Emitter\SapiEmitterTrait::emitHeaders() + */ + private function emitStatusLine(ResponseInterface $response) : void + { + $reasonPhrase = $response->getReasonPhrase(); + $statusCode = $response->getStatusCode(); + + header(sprintf( + 'HTTP/%s %d%s', + $response->getProtocolVersion(), + $statusCode, + ($reasonPhrase ? ' ' . $reasonPhrase : '') + ), true, $statusCode); + } + + /** + * Emit response headers. + * + * Loops through each header, emitting each; if the header value + * is an array with multiple values, ensures that each is sent + * in such a way as to create aggregate headers (instead of replace + * the previous). + */ + private function emitHeaders(ResponseInterface $response) : void + { + $statusCode = $response->getStatusCode(); + + foreach ($response->getHeaders() as $header => $values) { + $name = $this->filterHeader($header); + $first = $name === 'Set-Cookie' ? false : true; + foreach ($values as $value) { + header(sprintf( + '%s: %s', + $name, + $value + ), $first, $statusCode); + $first = false; + } + } + } + + /** + * Filter a header name to wordcase + */ + private function filterHeader(string $header) : string + { + return ucwords($header, '-'); + } +} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiStreamEmitter.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiStreamEmitter.php new file mode 100644 index 0000000000..7dfce3d6a5 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Emitter/SapiStreamEmitter.php @@ -0,0 +1,135 @@ +maxBufferLength = $maxBufferLength; + } + + /** + * Emits a response for a PHP SAPI environment. + * + * Emits the status line and headers via the header() function, and the + * body content via the output buffer. + */ + public function emit(ResponseInterface $response) : bool + { + $this->assertNoPreviousOutput(); + $this->emitHeaders($response); + $this->emitStatusLine($response); + + flush(); + + $range = $this->parseContentRange($response->getHeaderLine('Content-Range')); + + if (null === $range || 'bytes' !== $range[0]) { + $this->emitBody($response); + return true; + } + + $this->emitBodyRange($range, $response); + return true; + } + + /** + * Emit the message body. + */ + private function emitBody(ResponseInterface $response) : void + { + $body = $response->getBody(); + + if ($body->isSeekable()) { + $body->rewind(); + } + + if (! $body->isReadable()) { + echo $body; + return; + } + + while (! $body->eof()) { + echo $body->read($this->maxBufferLength); + } + } + + /** + * Emit a range of the message body. + */ + private function emitBodyRange(array $range, ResponseInterface $response) : void + { + list($unit, $first, $last, $length) = $range; + + $body = $response->getBody(); + + $length = $last - $first + 1; + + if ($body->isSeekable()) { + $body->seek($first); + + $first = 0; + } + + if (! $body->isReadable()) { + echo substr($body->getContents(), $first, $length); + return; + } + + $remaining = $length; + + while ($remaining >= $this->maxBufferLength && ! $body->eof()) { + $contents = $body->read($this->maxBufferLength); + $remaining -= strlen($contents); + + echo $contents; + } + + if ($remaining > 0 && ! $body->eof()) { + echo $body->read($remaining); + } + } + + /** + * Parse content-range header + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16 + * + * @return null|array [unit, first, last, length]; returns null if no + * content range or an invalid content range is provided + */ + private function parseContentRange(string $header) : ?array + { + if (! preg_match('/(?P[\w]+)\s+(?P\d+)-(?P\d+)\/(?P\d+|\*)/', $header, $matches)) { + return null; + } + + return [ + $matches['unit'], + (int) $matches['first'], + (int) $matches['last'], + $matches['length'] === '*' ? '*' : (int) $matches['length'], + ]; + } +} diff --git a/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php new file mode 100644 index 0000000000..fa66fbf969 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php @@ -0,0 +1,26 @@ +handler = $handler; + $this->emitter = $emitter; + + // Factories are cast as Closures to ensure return type safety. + $this->serverRequestFactory = function () use ($serverRequestFactory) : ServerRequestInterface { + return $serverRequestFactory(); + }; + + $this->serverRequestErrorResponseGenerator = + function (Throwable $exception) use ($serverRequestErrorResponseGenerator) : ResponseInterface { + return $serverRequestErrorResponseGenerator($exception); + }; + } + + /** + * Run the application + */ + public function run() : void + { + try { + $request = ($this->serverRequestFactory)(); + } catch (Throwable $e) { + // Error in generating the request + $this->emitMarshalServerRequestException($e); + return; + } + + $response = $this->handler->handle($request); + + $this->emitter->emit($response); + } + + private function emitMarshalServerRequestException(Throwable $exception) : void + { + $response = ($this->serverRequestErrorResponseGenerator)($exception); + $this->emitter->emit($response); + } +} diff --git a/wcfsetup/install/files/lib/system/api/psr/http-server-handler/LICENSE b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/LICENSE new file mode 100644 index 0000000000..b71ec5dfc2 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/wcfsetup/install/files/lib/system/api/psr/http-server-handler/README.md b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/README.md new file mode 100644 index 0000000000..1b7b4860c1 --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/README.md @@ -0,0 +1,6 @@ +HTTP Server Handler +=================== + +Provides the `RequestHandlerInterface` of [PSR-15][psr-15]. + +[psr-15]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md diff --git a/wcfsetup/install/files/lib/system/api/psr/http-server-handler/composer.json b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/composer.json new file mode 100644 index 0000000000..9e8b51d1ee --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/composer.json @@ -0,0 +1,36 @@ +{ + "name": "psr/http-server-handler", + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "psr", + "psr-7", + "psr-15", + "http-interop", + "http", + "server", + "handler", + "request", + "response" + ], + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/wcfsetup/install/files/lib/system/api/psr/http-server-handler/src/RequestHandlerInterface.php b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/src/RequestHandlerInterface.php new file mode 100644 index 0000000000..83911e265b --- /dev/null +++ b/wcfsetup/install/files/lib/system/api/psr/http-server-handler/src/RequestHandlerInterface.php @@ -0,0 +1,22 @@ +