Closed fritzmg closed 7 years ago
app/config/config.yml
doctrine: dbal: connections: second: driver: pdo_mysql host: '%second_database_host%' port: '%second_database_port%' dbname: '%second_database_name%' user: '%second_database_user%' password: '%second_database_password%' charset: UTF8
app/config/parameters.yml
parameters: … second_database_host: … second_database_port: … second_database_user: … second_database_password: … second_database_name: …
\System::getContainer()->get('doctrine')->getConnection('second');
The following error will occur:
Doctrine ORM Connection named "second" does not exist.
Same with
\System::getContainer()->get('doctrine.dbal.second_connection');
»
You have requested a non-existent service "doctrine.dbal.second_connection". Did you mean this: "doctrine.dbal.default_connection"?
nvm, I had an additional config_dev.yml and thus the config.yml was simply not loaded. See https://github.com/contao/manager-bundle/issues/44
config_dev.yml
config.yml
Reproduction
app/config/config.yml
withapp/config/parameters.yml
The following error will occur:
Same with
»