From: Tim Düsterhus Date: Wed, 30 Sep 2020 10:27:30 +0000 (+0200) Subject: Update to Guzzle 6.5 with backported guzzle/guzzle#2741 X-Git-Tag: 5.3.0_Beta_2~14^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=913cdefbbad21195390a59b4bd12dec1b10e7ad8;p=GitHub%2FWoltLab%2FWCF.git Update to Guzzle 6.5 with backported guzzle/guzzle#2741 --- diff --git a/wcfsetup/install/files/lib/system/api/composer.json b/wcfsetup/install/files/lib/system/api/composer.json index 122cfe8e17..0ea471ca44 100644 --- a/wcfsetup/install/files/lib/system/api/composer.json +++ b/wcfsetup/install/files/lib/system/api/composer.json @@ -15,6 +15,13 @@ "true/punycode": "~2.0", "pear/net_idna2": "^0.2.0", "scssphp/scssphp": "^1.1", - "guzzlehttp/guzzle": "^6.5" - } + "guzzlehttp/guzzle": "dev-6.5-windows" + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/WoltLab/guzzle", + "no-api": true + } + ] } diff --git a/wcfsetup/install/files/lib/system/api/composer.lock b/wcfsetup/install/files/lib/system/api/composer.lock index 1390129dfa..399dc02aec 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": "637eee25ca708b927eb477c205f58476", + "content-hash": "84035248a681a0748790233bd2a4189f", "packages": [ { "name": "chrisjean/php-ico", @@ -144,16 +144,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.5", + "version": "dev-6.5-windows", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + "url": "https://github.com/WoltLab/guzzle", + "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "url": "https://api.github.com/repos/WoltLab/guzzle/zipball/2d4592a12d3d6757f9969122730e69d6b7c82af0", + "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0", "shasum": "" }, "require": { @@ -185,7 +185,11 @@ "src/functions_include.php" ] }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + }, "license": [ "MIT" ], @@ -199,15 +203,15 @@ "description": "Guzzle is a PHP HTTP client library", "homepage": "http://guzzlephp.org/", "keywords": [ + "HTTP client", "client", "curl", "framework", "http", - "http client", "rest", "web service" ], - "time": "2020-06-16T21:01:06+00:00" + "time": "2020-09-30T10:06:20+00:00" }, { "name": "guzzlehttp/promises", @@ -1002,7 +1006,9 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "guzzlehttp/guzzle": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/wcfsetup/install/files/lib/system/api/composer/installed.json b/wcfsetup/install/files/lib/system/api/composer/installed.json index c80236c8d5..0cc5f5690e 100644 --- a/wcfsetup/install/files/lib/system/api/composer/installed.json +++ b/wcfsetup/install/files/lib/system/api/composer/installed.json @@ -143,17 +143,17 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.5", - "version_normalized": "6.5.5.0", + "version": "dev-6.5-windows", + "version_normalized": "dev-6.5-windows", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + "url": "https://github.com/WoltLab/guzzle", + "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "url": "https://api.github.com/repos/WoltLab/guzzle/zipball/2d4592a12d3d6757f9969122730e69d6b7c82af0", + "reference": "2d4592a12d3d6757f9969122730e69d6b7c82af0", "shasum": "" }, "require": { @@ -171,7 +171,7 @@ "suggest": { "psr/log": "Required for using the Log middleware" }, - "time": "2020-06-16T21:01:06+00:00", + "time": "2020-09-30T10:06:20+00:00", "type": "library", "extra": { "branch-alias": { @@ -187,7 +187,11 @@ "src/functions_include.php" ] }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + }, "license": [ "MIT" ], @@ -201,11 +205,11 @@ "description": "Guzzle is a PHP HTTP client library", "homepage": "http://guzzlephp.org/", "keywords": [ + "HTTP client", "client", "curl", "framework", "http", - "http client", "rest", "web service" ] diff --git a/wcfsetup/install/files/lib/system/api/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/wcfsetup/install/files/lib/system/api/guzzlehttp/guzzle/src/Handler/CurlFactory.php index 4a28a96ebc..48d909383c 100644 --- a/wcfsetup/install/files/lib/system/api/guzzlehttp/guzzle/src/Handler/CurlFactory.php +++ b/wcfsetup/install/files/lib/system/api/guzzlehttp/guzzle/src/Handler/CurlFactory.php @@ -4,7 +4,6 @@ namespace GuzzleHttp\Handler; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Promise\FulfilledPromise; -use GuzzleHttp\Psr7; use GuzzleHttp\Psr7\LazyOpenStream; use GuzzleHttp\TransferStats; use Psr\Http\Message\RequestInterface; @@ -376,7 +375,12 @@ class CurlFactory implements CurlFactoryInterface } } - if (isset($options['sink'])) { + // Do not connect a sink for HEAD requests. + if ($easy->request->getMethod() !== 'HEAD') { + if (!isset($options['sink'])) { + // Use a default temp stream if no sink was set. + $options['sink'] = \fopen('php://temp', 'w+'); + } $sink = $options['sink']; if (!is_string($sink)) { $sink = \GuzzleHttp\Psr7\stream_for($sink); @@ -394,11 +398,8 @@ class CurlFactory implements CurlFactoryInterface $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { return $sink->write($write); }; - } else { - // Use a default temp stream if no sink was set. - $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); - $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); } + $timeoutRequiresNoSignal = false; if (isset($options['timeout'])) { $timeoutRequiresNoSignal |= $options['timeout'] < 1;