|
61 | 61 | use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
62 | 62 | use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
|
63 | 63 | use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
| 64 | +use Symfony\Component\Stopwatch\Stopwatch; |
64 | 65 | use Symfony\Component\Validator\ConstraintValidatorInterface;
|
65 | 66 | use Symfony\Component\Validator\ObjectInitializerInterface;
|
66 | 67 | use Symfony\Component\WebLink\HttpHeaderSerializer;
|
@@ -639,9 +640,14 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
|
639 | 640 | {
|
640 | 641 | $loader->load('debug_prod.xml');
|
641 | 642 |
|
| 643 | + if (class_exists(Stopwatch::class)) { |
| 644 | + $container->register('debug.stopwatch', Stopwatch::class); |
| 645 | + $container->setAlias(Stopwatch::class, 'debug.stopwatch'); |
| 646 | + } |
| 647 | + |
642 | 648 | $debug = $container->getParameter('kernel.debug');
|
643 | 649 |
|
644 |
| - if ($debug) { |
| 650 | + if ($debug && class_exists(Stopwatch::class)) { |
645 | 651 | $loader->load('debug.xml');
|
646 | 652 | }
|
647 | 653 |
|
@@ -881,7 +887,7 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
|
881 | 887 |
|
882 | 888 | $container->setParameter('templating.helper.form.resources', $config['form']['resources']);
|
883 | 889 |
|
884 |
| - if ($container->getParameter('kernel.debug')) { |
| 890 | + if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class)) { |
885 | 891 | $loader->load('templating_debug.xml');
|
886 | 892 |
|
887 | 893 | $container->setDefinition('templating.engine.php', $container->findDefinition('debug.templating.engine.php'));
|
|
0 commit comments