Browse Source

Merge pull request #377 from nibsirahsieu/issue_365

set `defaultConnection` value for both `runtime` and `generator`
pull/373/head
Toni Uebernickel 4 years ago
parent
commit
58b80628dd
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      DependencyInjection/PropelExtension.php

+ 10
- 0
DependencyInjection/PropelExtension.php View File

@@ -36,6 +36,16 @@ class PropelExtension extends Extension
$configuration = $this->getConfiguration($configs, $container);
$config = $processor->processConfiguration($configuration, $configs);

if (1 === count($config['database']['connections'])) {
$defaultConnection = array_keys($config['database']['connections'])[0];
if (!isset($config['runtime']['defaultConnection'])) {
$config['runtime']['defaultConnection'] = $defaultConnection;
}
if (!isset($config['generator']['defaultConnection'])) {
$config['generator']['defaultConnection'] = $defaultConnection;
}
}
$container->setParameter('propel.logging', $config['runtime']['logging']);
$container->setParameter('propel.configuration', $config);



Loading…
Cancel
Save