浏览代码

[DoctrineBundle] fixed compiler pass, to stop if orm wasn't enabled

Bulat Shakirzyanov 14 年之前
父节点
当前提交
b3e998efa9

+ 4 - 1
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Compiler/CreateProxyDirectoryPass.php

@@ -9,6 +9,9 @@ class CreateProxyDirectoryPass implements CompilerPassInterface
 {
     public function process(ContainerBuilder $container)
     {
+        if (!$container->hasParameter('doctrine.orm.proxy_dir')) {
+            return;
+        }
         $proxyCacheDir = $container->getParameter('doctrine.orm.proxy_dir');
         // Create entity proxy directory
         if (!is_dir($proxyCacheDir)) {
@@ -19,4 +22,4 @@ class CreateProxyDirectoryPass implements CompilerPassInterface
             throw new \RuntimeException(sprintf('Unable to write in the Doctrine Proxy directory (%s)', $proxyCacheDir));
         }
     }
-}
+}