|
43 | 43 | use Symfony\Component\Form\DependencyInjection\FormPass;
|
44 | 44 | use Symfony\Component\HttpFoundation\Request;
|
45 | 45 | use Symfony\Component\HttpKernel\Bundle\Bundle;
|
| 46 | +use Symfony\Component\HttpKernel\KernelEvents; |
46 | 47 | use Symfony\Component\Config\Resource\ClassExistenceResource;
|
47 | 48 | use Symfony\Component\Translation\DependencyInjection\TranslationDumperPass;
|
48 | 49 | use Symfony\Component\Translation\DependencyInjection\TranslationExtractorPass;
|
@@ -83,14 +84,22 @@ public function build(ContainerBuilder $container)
|
83 | 84 | {
|
84 | 85 | parent::build($container);
|
85 | 86 |
|
| 87 | + $hotPathEvents = array( |
| 88 | + KernelEvents::REQUEST, |
| 89 | + KernelEvents::CONTROLLER, |
| 90 | + KernelEvents::CONTROLLER_ARGUMENTS, |
| 91 | + KernelEvents::RESPONSE, |
| 92 | + KernelEvents::FINISH_REQUEST, |
| 93 | + ); |
| 94 | + |
86 | 95 | $container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
|
87 | 96 | $container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
|
88 | 97 | $container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);
|
89 | 98 | $container->addCompilerPass(new RoutingResolverPass());
|
90 | 99 | $container->addCompilerPass(new ProfilerPass());
|
91 | 100 | // must be registered before removing private services as some might be listeners/subscribers
|
92 | 101 | // but as late as possible to get resolved parameters
|
93 |
| - $container->addCompilerPass(new RegisterListenersPass(), PassConfig::TYPE_BEFORE_REMOVING); |
| 102 | + $container->addCompilerPass((new RegisterListenersPass())->setHotPathEvents($hotPathEvents), PassConfig::TYPE_BEFORE_REMOVING); |
94 | 103 | $container->addCompilerPass(new TemplatingPass());
|
95 | 104 | $this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class, PassConfig::TYPE_BEFORE_REMOVING);
|
96 | 105 | $container->addCompilerPass(new AddAnnotationsCachedReaderPass(), PassConfig::TYPE_BEFORE_REMOVING);
|
|
0 commit comments