8000 bug #53870 [Dotenv] Specify envKey while loading variables with the d… · priyadi/symfony@b45ebf9 · GitHub
[go: up one dir, main page]

Skip to content

Commit b45ebf9

Browse files
bug symfony#53870 [Dotenv] Specify envKey while loading variables with the dotenv:dump (scruwi)
This PR was merged into the 6.4 branch. Discussion ---------- [Dotenv] Specify envKey while loading variables with the dotenv:dump | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#53864 | License | MIT `bin/console dotenv:dump` incorrectly detected envKey if it differs from APP_ENV Commits ------- f188a24 [Dotenv] Specify envKey while loading variables with the dotenv:dump command
2 parents 84c231e + f188a24 commit b45ebf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9595

9696
private function loadEnv(string $dotenvPath, string $env, array $config): array
9797
{
98-
$dotenv = new Dotenv();
9998
$envKey = $config['env_var_name'] ?? 'APP_ENV';
10099
$testEnvs = $config['test_envs'] ?? ['test'];
101100

101+
$dotenv = new Dotenv($envKey);
102+
102103
$globalsBackup = [$_SERVER, $_ENV];
103104
unset($_SERVER[$envKey]);
104105
$_ENV = [$envKey => $env];

0 commit comments

Comments
 (0)
0