I have a settings file in an application using the Symfony 3.2 console, configuration, and the YAML component , and I'm trying to set external Settings from the environment in the Service Container settings.
I create a container constructor.
$container = new ContainerBuilder();
Use the file locator to search for resources:
$container = new ContainerBuilder();
Bootloader manager to load resources
LoaderResolver();
And using the boot method:
$this->load('parameters.yml');
parameters.yml file:
parameters:
database:
driver: pdo_mysql
host: 127.0.0.1
dbname: dbname
user: env(VAL1)
password: env(VAL2)
Local: us-en
After compiling the container and try checking the values from the parameter package:
$container->getParameterBag()->all()
returns values similar to this:
env_VAL1_3ec776edc429c1734ed780a29a0af538, env_VAL2_3ec776edc429c1734ed780a29a0af538
I think the container cannot resolve these values from the environment.
. , :
$ export VAL1='SOME TEXT'
- , ?