check whether the value of defaultConnection have been set or not

This commit is contained in:
Yunan NSNT 2015-12-18 10:16:07 +07:00
parent 8d8cc7be79
commit 301df4331c

View file

@ -38,8 +38,12 @@ class PropelExtension extends Extension
if (1 === count($config['database']['connections'])) {
$defaultConnection = array_keys($config['database']['connections'])[0];
$config['runtime']['defaultConnection'] = $defaultConnection;
$config['generator']['defaultConnection'] = $defaultConnection;
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']);