From eb27ff370248e0c59cd558f360f6a6d1a572e79d Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 6 May 2023 18:42:28 +0200 Subject: [PATCH] Prefer php-http/discovery over nyholm/psr7 when installed (#1198) --- nyholm/psr7/1.0/manifest.json | 3 +++ .../discovery/1.18/config/packages/http_discovery.yaml | 10 ++++++++++ php-http/discovery/1.18/manifest.json | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 php-http/discovery/1.18/config/packages/http_discovery.yaml create mode 100644 php-http/discovery/1.18/manifest.json diff --git a/nyholm/psr7/1.0/manifest.json b/nyholm/psr7/1.0/manifest.json index e164c6e6..e06ab6cf 100644 --- a/nyholm/psr7/1.0/manifest.json +++ b/nyholm/psr7/1.0/manifest.json @@ -1,5 +1,8 @@ { "copy-from-recipe": { "config/": "%CONFIG_DIR%/" + }, + "conflict": { + "php-http/discovery": ">=1.18" } } diff --git a/php-http/discovery/1.18/config/packages/http_discovery.yaml b/php-http/discovery/1.18/config/packages/http_discovery.yaml new file mode 100644 index 00000000..2a789e73 --- /dev/null +++ b/php-http/discovery/1.18/config/packages/http_discovery.yaml @@ -0,0 +1,10 @@ +services: + Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory' + + http_discovery.psr17_factory: + class: Http\Discovery\Psr17Factory diff --git a/php-http/discovery/1.18/manifest.json b/php-http/discovery/1.18/manifest.json new file mode 100644 index 00000000..e164c6e6 --- /dev/null +++ b/php-http/discovery/1.18/manifest.json @@ -0,0 +1,5 @@ +{ + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +}