Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Nov 27, 2024
2 parents 07b2c58 + 245d1af commit 28347a8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}

$filePath = $_SERVER['SYMFONY_DOTENV_PATH'] ?? $this->projectDirectory.\DIRECTORY_SEPARATOR.'.env';
if (!$filePath = $_SERVER['SYMFONY_DOTENV_PATH'] ?? null) {
$dotenvPath = $this->projectDirectory;

if (is_file($composerFile = $this->projectDirectory.'/composer.json')) {
$runtimeConfig = (json_decode(file_get_contents($composerFile), true))['extra']['runtime'] ?? [];

if (isset($runtimeConfig['dotenv_path'])) {
$dotenvPath = $this->projectDirectory.'/'.$runtimeConfig['dotenv_path'];
}
}

$filePath = $dotenvPath.'/.env';
}

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

0 comments on commit 28347a8

Please sign in to comment.