Skip to content

Commit 28347a8

Browse files
Merge branch '7.1' into 7.2
* 7.1: [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 07b2c58 + 245d1af commit 28347a8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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');

0 commit comments

Comments
 (0)