First line correctly outputs the DB_NAME
But drush output is DB name :
(same for all other .env DB credentials)
Any advanced drush commands using the DB credentials from the .env file fail with a message like
Command cache:rebuild was not found. Drush was unable to query the database.
Same command directly launched from Bash respect the .env from the autoloader
Bash:
user@~/composer_root: ./vendor/bin/drush st
output DB name : MY_DBNAME_FROM_DOTENV
System Configuration
Composer 2.5.8
Robo 4.0.6
Drush 12.1.2.0
PHP 8.1.21 on Fedora
Steps to reproduce
What did you do?
Providing environment variables with vlucas/phpdotenv Autoloading .env file similar to drupal-composer/drupal-project
Expected behavior
$_ENV should be available in all scripts executed by Robo
Actual behavior
$_ENV is not available in Drush launched through Robo
RoboFile.php
Drupal settings.php
First line correctly outputs the DB_NAME But drush output is
DB name :
(same for all other .env DB credentials) Any advanced drush commands using the DB credentials from the .env file fail with a message likeCommand cache:rebuild was not found. Drush was unable to query the database.
Same command directly launched from Bash respect the .env from the autoloader Bash:
output
DB name : MY_DBNAME_FROM_DOTENV
System Configuration
Composer 2.5.8 Robo 4.0.6 Drush 12.1.2.0 PHP 8.1.21 on Fedora