Skip to content

Commit dfff0df

Browse files
committed
only load console profiling if console is actually available
this fixes a regression introduced in ea5a3cc
1 parent 6597db1 commit dfff0df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public function load(array $configs, ContainerBuilder $container): void
579579
$this->registerNotifierConfiguration($config['notifier'], $container, $loader, $this->readConfigEnabled('webhook', $container, $config['webhook']));
580580
}
581581

582-
// profiler depends on form, validation, translation, messenger, mailer, http-client, notifier, serializer being registered
582+
// profiler depends on form, validation, translation, messenger, mailer, http-client, notifier, serializer being registered. console is optional.
583583
$this->registerProfilerConfiguration($config['profiler'], $container, $loader);
584584

585585
if ($this->readConfigEnabled('webhook', $container, $config['webhook'])) {
@@ -992,7 +992,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
992992
$container->getDefinition('profiler_listener')
993993
->addArgument($config['collect_parameter']);
994994

995-
if (!$container->getParameter('kernel.debug') || !$container->has('debug.stopwatch')) {
995+
if (!$container->getParameter('kernel.debug') || !$this->hasConsole() || !$container->has('debug.stopwatch')) {
996996
$container->removeDefinition('console_profiler_listener');
997997
}
998998
}

0 commit comments

Comments
 (0)