Преглед на файлове

[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);
+        }
     }
 }