[PropelBundle] fixed Propel configuraiton when no dbal is configured

This commit is contained in:
Fabien Potencier 2010-06-12 14:36:11 +02:00
parent b48cc5b311
commit 16f7d3a040
2 changed files with 8 additions and 5 deletions

View File

@ -23,6 +23,11 @@ class PropelExtension extends LoaderExtension
*/
public function configLoad($config, BuilderConfiguration $configuration)
{
if (!$configuration->hasDefinition('propel')) {
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
$configuration->merge($loader->load($this->resources['propel']));
}
if (!$configuration->hasParameter('propel.path')) {
if (!isset($config['path'])) {
throw new \InvalidArgumentException('The "path" parameter is mandatory.');
@ -31,13 +36,11 @@ class PropelExtension extends LoaderExtension
$configuration->setParameter('propel.path', $config['path']);
}
if (isset($config['path']))
{
if (isset($config['path'])) {
$configuration->setParameter('propel.path', $config['path']);
}
if (isset($config['phing_path']))
{
if (isset($config['phing_path'])) {
$configuration->setParameter('propel.phing_path', $config['phing_path']);
}

View File

@ -1,3 +1,3 @@
homepage:
pattern: /
pattern: /
defaults: { _controller: WebBundle:Default:index }