Skip to content

Commit 2e9c8bd

Browse files
bobvandevijvernicolas-grekas
authored andcommitted
Only register PhpConfigReferenceDumpPass in dev env with debug flag enabled
1 parent 3f750bb commit 2e9c8bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ public function build(ContainerBuilder $container): void
149149
]);
150150
}
151151

152-
if ($container->hasParameter('.kernel.config_dir') && $container->hasParameter('.kernel.bundles_definition')) {
153-
$container->addCompilerPass(new PhpConfigReferenceDumpPass($container->getParameter('.kernel.config_dir').'/reference.php', $container->getParameter('.kernel.bundles_definition')));
154-
}
155152
$container->addCompilerPass(new AssetsContextPass());
156153
$container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
157154
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
@@ -208,6 +205,9 @@ public function build(ContainerBuilder $container): void
208205
$this->addCompilerPassIfExists($container, StreamablePass::class);
209206

210207
if ($container->getParameter('kernel.debug')) {
208+
if ($container->hasParameter('.kernel.config_dir') && $container->hasParameter('.kernel.bundles_definition')) {
209+
$container->addCompilerPass(new PhpConfigReferenceDumpPass($container->getParameter('.kernel.config_dir').'/reference.php', $container->getParameter('.kernel.bundles_definition')));
210+
}
211211
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 2);
212212
$container->addCompilerPass(new UnusedTagsPass(), PassConfig::TYPE_AFTER_REMOVING);
213213
$container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_BEFORE_REMOVING, -255);

0 commit comments

Comments
 (0)