Merge pull request #392 from havvg/1.5
use scalar for default connection alias
This commit is contained in:
commit
3c50d7859c
|
@ -383,6 +383,10 @@ EOT
|
|||
|
||||
$propelConfiguration = $container->get('propel.configuration');
|
||||
foreach ($propelConfiguration['datasources'] as $name => $datasource) {
|
||||
if (is_scalar($datasource)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$xml .= strtr(<<<EOT
|
||||
<datasource id="%name%">
|
||||
<adapter>%adapter%</adapter>
|
||||
|
|
|
@ -111,6 +111,10 @@ EOT
|
|||
|
||||
$connections = array();
|
||||
foreach ($propelConfiguration['datasources'] as $name => $config) {
|
||||
if (is_scalar($config)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$connections[$name] = $config['connection'];
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class PropelExtension extends Extension
|
|||
|
||||
// Alias the default connection if not defined
|
||||
if (!isset($c['datasources']['default'])) {
|
||||
$c['datasources']['default'] = $c['datasources'][$connectionName];
|
||||
$c['datasources']['default'] = $connectionName;
|
||||
}
|
||||
|
||||
$container->getDefinition('propel.configuration')->setArguments(array($c));
|
||||
|
|
Loading…
Reference in a new issue