diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php index 245db8f..216fa5a 100644 --- a/core/lib/Drupal/Core/CoreServiceProvider.php +++ b/core/lib/Drupal/Core/CoreServiceProvider.php @@ -61,6 +61,8 @@ public function register(ContainerBuilder $container) { // list-building passes are operating on the post-alter services list. $container->addCompilerPass(new ModifyServiceDefinitionsPass()); + $container->addCompilerPass(new ProxyServicesPass()); + $container->addCompilerPass(new BackendCompilerPass()); $container->addCompilerPass(new StackedKernelPass()); @@ -91,8 +93,6 @@ public function register(ContainerBuilder $container) { $container->addCompilerPass(new PluginManagerPass()); $container->addCompilerPass(new DependencySerializationTraitPass()); - - $container->addCompilerPass(new ProxyServicesPass()); } /** diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/ProxyServicesPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/ProxyServicesPass.php index 494e8db..9afcba4 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/ProxyServicesPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/ProxyServicesPass.php @@ -23,6 +23,7 @@ class ProxyServicesPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { foreach ($container->getDefinitions() as $service_id => $definition) { if ($definition->isLazy()) { + debug($definition->getClass()); // Copy the existing definition to a new entry. $definition->setLazy(FALSE); // Ensure that the service is accessible. diff --git a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php b/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php index 3096310..ab49424 100644 --- a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php +++ b/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php @@ -53,6 +53,8 @@ public function testRequest() { * Tests that late middlewares are automatically flagged lazy. */ public function testLazyLateMiddlewares() { + debug($this->container->getDefinition('http_middleware.reverse_proxy')->getClass()); + debug($this->container->getDefinition('http_middleware.kernel_pre_handle')->getClass()); $this->assertFalse($this->container->getDefinition('http_middleware.reverse_proxy')->isLazy(), 'lazy flag on http_middleware.reverse_proxy definition is not set'); $this->assertFalse($this->container->getDefinition('http_middleware.kernel_pre_handle')->isLazy(), 'lazy flag on http_middleware.kernel_pre_handle definition is not set'); $this->assertFalse($this->container->getDefinition('http_middleware.session')->isLazy(), 'lazy flag on http_middleware.session definition is not set');