소스 검색

[DependencyInjection] enable debug related passes only in debug environment

Johannes M. Schmitt 14 년 전
부모
커밋
49ecb90221
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

+ 5 - 2
src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

@@ -82,7 +82,10 @@ class FrameworkBundle extends Bundle
         $container->addCompilerPass(new AddClassesToAutoloadMapPass());
         $container->addCompilerPass(new TranslatorPass());
         $container->addCompilerPass(new AddCacheWarmerPass());
-        $container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_BEFORE_REMOVING);
-        $container->addCompilerPass(new CompilerDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING);
+
+        if ($container->getParameter('kernel.debug')) {
+            $container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_BEFORE_REMOVING);
+            $container->addCompilerPass(new CompilerDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING);
+        }
     }
 }