8000 [Dotenv] Specify envKey while loading variables with the dotenv:dump … · priyadi/symfony@f188a24 · GitHub
[go: up one dir, main page]

Skip to content

Commit f188a24

Browse files
committed
[Dotenv] Specify envKey while loading variables with the dotenv:dump command
1 parent fa843ce commit f188a24

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