|
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; |
@@ -75,14 +76,22 @@ public function build(ContainerBuilder $container) |
75 | 76 | { |
76 | 77 | parent::build($container); |
77 | 78 |
|
| 79 | + $hotPathEvents = array( |
| 80 | + KernelEvents::REQUEST, |
| 81 | + KernelEvents::CONTROLLER, |
| 82 | + KernelEvents::CONTROLLER_ARGUMENTS, |
| 83 | + KernelEvents::RESPONSE, |
| 84 | + KernelEvents::FINISH_REQUEST, |
| 85 | + ); |
| 86 | + |
78 | 87 | $container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32); |
79 | 88 | $container->addCompilerPass(new RegisterControllerArgumentLocatorsPass()); |
80 | 89 | $container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING); |
81 | 90 | $container->addCompilerPass(new RoutingResolverPass()); |
82 | 91 | $container->addCompilerPass(new ProfilerPass()); |
83 | 92 | // must be registered before removing private services as some might be listeners/subscribers |
84 | 93 | // but as late as possible to get resolved parameters |
85 | | - $container->addCompilerPass(new RegisterListenersPass(), PassConfig::TYPE_BEFORE_REMOVING); |
| 94 | + $container->addCompilerPass((new RegisterListenersPass())->setHotPathEvents($hotPathEvents), PassConfig::TYPE_BEFORE_REMOVING); |
86 | 95 | $container->addCompilerPass(new TemplatingPass()); |
87 | 96 | $this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class, PassConfig::TYPE_BEFORE_REMOVING); |
88 | 97 | $container->addCompilerPass(new AddAnnotationsCachedReaderPass(), PassConfig::TYPE_BEFORE_REMOVING); |
|
0 commit comments