I am resolving .env like this.
$dotenv = new Dotenv();
$dotenv->load(__DIR__ . '/../.env');
$_ENV seems to be loaded as expcted, when I dumping it. However getenv(”) just returns false for any of my cases.
I am also using symfony/yaml and ‘%env(DB_HOST)%’ seems to be resolved encrypted like this “env_a29ffbaf71844d60_DB_PORT_b9ae345956b17326add18c425a0a8116”.
Why is it hashed?
DoctrineDBALConnection:
factory: [ 'DoctrineDBALDriverManager', 'getConnection' ]
arguments:
- { driver: pdo_pgsql, host: '%env(DB_HOST)%', port: '%env(DB_PORT)%', dbname: '%env(DB_DATABASE)%', user: '%env(DB_USERNAME)%', password: '%env(DB_PASSWORD)%' }
Note: I am not using the whole symfony framework, just some parts of it.