From 1be39497809c02fb5a6649e1816d40b166cee6d8 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Mon, 11 Apr 2011 13:46:23 +0200 Subject: [PATCH] Fixed loaded configuration --- DependencyInjection/PropelExtension.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DependencyInjection/PropelExtension.php b/DependencyInjection/PropelExtension.php index b36d9ea..bfdc4e5 100644 --- a/DependencyInjection/PropelExtension.php +++ b/DependencyInjection/PropelExtension.php @@ -89,19 +89,21 @@ class PropelExtension extends Extension $connectionName = $config['default_connection']; $container->setParameter('propel.dbal.default_connection', $connectionName); - if (0 == count($config['connections'])) { + if (0 === count($config['connections'])) { $config['connections'] = array($connectionName => $config); } $c = array(); foreach ($config['connections'] as $name => $conf) { - $c['datasources'][$name]['adapter'] = $config['connections'][$name]['driver']; + $c['datasources'][$name]['adapter'] = $conf['driver']; foreach (array('dsn', 'user', 'password', 'classname', 'options', 'attributes', 'settings') as $att) { - if (isset($config['connections'][$name][$att])) { - $c['datasources'][$name]['connection'][$att] = $config['connections'][$name][$att]; + if (isset($conf[$att])) { + $c['datasources'][$name]['connection'][$att] = $conf[$att]; } } + + $c['datasources'][$name]['connection']['settings']['charset'] = array('value' => $container->getParameter('propel.charset')); } $container->getDefinition('propel.configuration')->setArguments(array($c));