Skip to content

Commit 6f8f122

Browse files
Merge branch '7.2' into 7.3
* 7.2: [HttpClient] Close gracefull when the server closes the connection abruptly ensure that tests are run with lowest supported Serializer versions read runtime config from composer.json in debug dotenv command
2 parents 3feb53b + bffd7b8 commit 6f8f122

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Symfony/Component/Dotenv/Command/DebugCommand.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7777
return 1;
7878
}
7979

80-
$filePath = $_SERVER['SYMFONY_DOTENV_PATH'] ?? $this->projectDirectory.\DIRECTORY_SEPARATOR.'.env';
80+
if (!$filePath = $_SERVER['SYMFONY_DOTENV_PATH'] ?? null) {
81+
$dotenvPath = $this->projectDirectory;
82+
83+
if (is_file($composerFile = $this->projectDirectory.'/composer.json')) {
84+
$runtimeConfig = (json_decode(file_get_contents($composerFile), true))['extra']['runtime'] ?? [];
85+
86+
if (isset($runtimeConfig['dotenv_path'])) {
87+
$dotenvPath = $this->projectDirectory.'/'.$runtimeConfig['dotenv_path'];
88+
}
89+
}
90+
91+
$filePath = $dotenvPath.'/.env';
92+
}
8193

8294
$envFiles = $this->getEnvFiles($filePath);
8395
$availableFiles = array_filter($envFiles, 'is_file');

src/Symfony/Component/HttpClient/Response/CurlResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private static function perform(ClientState $multi, ?array &$responses = null):
323323
}
324324

325325
$multi->handlesActivity[$id][] = null;
326-
$multi->handlesActivity[$id][] = \in_array($result, [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || '_0' === $waitFor || curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) ? null : new TransportException(ucfirst(curl_error($ch) ?: curl_strerror($result)).\sprintf(' for "%s".', curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL)));
326+
$multi->handlesActivity[$id][] = \in_array($result, [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || '_0' === $waitFor || curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) || (curl_error($ch) === 'OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0' && -1.0 === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) && \in_array('close', array_map('strtolower', $responses[$id]->headers['connection']), true)) ? null : new TransportException(ucfirst(curl_error($ch) ?: curl_strerror($result)).\sprintf(' for "%s".', curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL)));
327327
}
328328
} finally {
329329
$multi->performing = false;

0 commit comments

Comments
 (0)