Closed
Description
Symfony version(s) affected
6.4
Description
If env_var_name
in composer.json
differs from the standard APP_ENV
, then .env.PRODUCTION
file will be ignored by the command bin/console dotenv:dump PRODUCTION
How to reproduce
composer.json:
"extra": {
"runtime": {
"env_var_name": "ENV"
}
}
Create files:
- .env
- .env.local
- .env.local.PRODUCTION
Run bin/console dotenv:dump PRODUCTION
Possible Solution
Method DotenvDumpCommand::loadEnv()
, instantiate DotEnv
with correct envKey
:
$envKey = $config['env_var_name'] ?? 'APP_ENV';
$dotenv = new Dotenv($envKey);
Additional Context
No response