Closed
Description
Symfony version(s) affected
5.4
Description
The console command bin/console debug:dotenv
ignores the dotenv_path
setting specified in the composer.json file.
How to reproduce
Let's assume that .env*
files should be located in the directory <app_root>/config
- Set the .env file path in composer.json using dotenv_path:
"extra": {
"runtime": {
"dotenv_path": "config/.env"
}
}
- Instantiate command:
$projectDirectory = '/var/www/api';
new DebugCommand($_ENV['APP_ENV'], $projectDirectory);
- Run the console command
bin/console dump:dotenv
- Observe that the command does not use the specified path.
Possible Solution
Use the same logic as in the dotenv:dump
command to determine the dotenv_path
.
Additional Context
No response