瀏覽代碼

[PropelBundle] fixed Propel configuraiton when no dbal is configured

Fabien Potencier 15 年之前
父節點
當前提交
16f7d3a040

+ 7 - 4
src/Symfony/Framework/PropelBundle/DependencyInjection/PropelExtension.php

@@ -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']);
         }
 

+ 1 - 1
src/Symfony/Framework/WebBundle/Resources/skeleton/application/yaml/config/routing.yml

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