diff --git a/composer.json b/composer.json index 1ae4906..9e95879 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,10 @@ "php": "7.1.*", "php-di/php-di": "^6.0", "relay/relay": "2.x@dev", - "zendframework/zend-diactoros": "^1.7", + "zendframework/zend-diactoros": "^2.1", "middlewares/fast-route": "^1.0", - "middlewares/request-handler": "^1.1" + "middlewares/request-handler": "^1.1", + "narrowspark/http-emitter": "^0.7.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index fd87ff3..6350a04 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "a6ae5e59a35b236a9430e9d8f7122271", + "content-hash": "86edb7ecc8b0e26c9a771fb364e14dc8", "packages": [ { "name": "http-interop/http-factory", @@ -56,6 +56,7 @@ "request", "response" ], + "abandoned": "psr/http-factory", "time": "2017-03-24T14:48:51+00:00" }, { @@ -270,6 +271,65 @@ ], "time": "2018-01-24T09:54:56+00:00" }, + { + "name": "narrowspark/http-emitter", + "version": "0.7.0", + "source": { + "type": "git", + "url": "https://github.com/narrowspark/http-emitter.git", + "reference": "571aaff4437e95de21ee5c92dc9ee41a291d988e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/narrowspark/http-emitter/zipball/571aaff4437e95de21ee5c92dc9ee41a291d988e", + "reference": "571aaff4437e95de21ee5c92dc9ee41a291d988e", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/http-message": "^1.0", + "symfony/polyfill-mbstring": "^1.8.0" + }, + "provide": { + "psr/container-implementation": "^1.0", + "psr/http-message-implementation": "^1.0" + }, + "require-dev": { + "narrowspark/coding-standard": "^1.4.0", + "phpunit/phpunit": "^7.0", + "zendframework/zend-diactoros": "^1.7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Narrowspark\\HttpEmitter\\": "src/" + }, + "exclude-from-classmap": [ + "tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bannert", + "email": "d.bannert@anolilab.de", + "homepage": "http://www.anolilab.de", + "role": "Developer" + } + ], + "description": "Emitting psr-7 responses.", + "keywords": [ + "emitter", + "http", + "narrowspark", + "psr-7", + "sapi" + ], + "time": "2018-10-31T12:31:29+00:00" + }, { "name": "nikic/fast-route", "version": "v1.3.0", @@ -558,6 +618,58 @@ ], "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "psr/http-factory", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/378bfe27931ecc54ff824a20d6f6bfc303bbd04c", + "reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2018-07-30T21:54:04+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -762,6 +874,65 @@ ], "time": "2018-02-13T21:34:17+00:00" }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, { "name": "symfony/polyfill-php56", "version": "v1.7.0", @@ -872,55 +1043,69 @@ }, { "name": "zendframework/zend-diactoros", - "version": "1.7.1", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "bf26aff803a11c5cc8eb7c4878a702c403ec67f1" + "reference": "c3c330192bc9cc51b7e9ce968ff721dc32ffa986" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/bf26aff803a11c5cc8eb7c4878a702c403ec67f1", - "reference": "bf26aff803a11c5cc8eb7c4878a702c403ec67f1", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/c3c330192bc9cc51b7e9ce968ff721dc32ffa986", + "reference": "c3c330192bc9cc51b7e9ce968ff721dc32ffa986", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "php": "^7.1", + "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { "ext-dom": "*", "ext-libxml": "*", - "phpunit/phpunit": "^5.7.16 || ^6.0.8", - "zendframework/zend-coding-standard": "~1.0" + "http-interop/http-factory-tests": "^0.5.0", + "php-http/psr7-integration-tests": "dev-master", + "phpunit/phpunit": "^7.0.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev", - "dev-develop": "1.8.x-dev" + "dev-master": "2.1.x-dev", + "dev-develop": "2.2.x-dev", + "dev-release-1.8": "1.8.x-dev" } }, "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php" + ], "psr-4": { "Zend\\Diactoros\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "BSD-3-Clause" ], "description": "PSR HTTP Message implementations", - "homepage": "https://github.com/zendframework/zend-diactoros", "keywords": [ "http", "psr", "psr-7" ], - "time": "2018-02-26T15:44:50+00:00" + "time": "2019-01-05T20:13:32+00:00" } ], "packages-dev": [], diff --git a/public/index.php b/public/index.php index 8e1e278..68cd1f5 100644 --- a/public/index.php +++ b/public/index.php @@ -6,9 +6,9 @@ use FastRoute\RouteCollector; use Middlewares\FastRoute; use Middlewares\RequestHandler; +use Narrowspark\HttpEmitter\SapiEmitter; use Relay\Relay; use Zend\Diactoros\Response; -use Zend\Diactoros\Response\SapiEmitter; use Zend\Diactoros\ServerRequestFactory; use function DI\create; use function DI\get;