diff --git a/Command/DotenvDumpCommand.php b/Command/DotenvDumpCommand.php index beec603..cd0fb5d 100644 --- a/Command/DotenvDumpCommand.php +++ b/Command/DotenvDumpCommand.php @@ -95,10 +95,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int private function loadEnv(string $dotenvPath, string $env, array $config): array { - $dotenv = new Dotenv(); $envKey = $config['env_var_name'] ?? 'APP_ENV'; $testEnvs = $config['test_envs'] ?? ['test']; + $dotenv = new Dotenv($envKey); + $globalsBackup = [$_SERVER, $_ENV]; unset($_SERVER[$envKey]); $_ENV = [$envKey => $env];