diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index 0d87ba2..afa5da6 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -246,7 +246,7 @@ public function build(ContainerBuilder $container) { $container->register('flood', 'Drupal\Core\Flood\DatabaseBackend') ->addArgument(new Reference('database')); - $container->register('service_terminator', 'Drupal\Core\ServiceTerminator') + $container->register('kernel_terminate_subscriber', 'Drupal\Core\EventSubscriber\KernelTerminateSubscriber') ->addArgument(new Reference('service_container')) ->addTag('event_subscriber'); diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForTerminationPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForTerminationPass.php index 7480fa5..5fb9e6b 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForTerminationPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForTerminationPass.php @@ -21,11 +21,11 @@ class RegisterServicesForTerminationPass implements CompilerPassInterface { * Implements CompilerPassInterface::process(). */ public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('service_terminator')) { + if (!$container->hasDefinition('kernel_terminate_subscriber')) { return; } - $definition = $container->getDefinition('service_terminator'); + $definition = $container->getDefinition('kernel_terminate_subscriber'); foreach ($container->findTaggedServiceIds('needs_termination') as $id => $attributes) { diff --git a/core/lib/Drupal/Core/ServiceTerminator.php b/core/lib/Drupal/Core/EventSubscriber/KernelTerminateSubscriber.php similarity index 88% rename from core/lib/Drupal/Core/ServiceTerminator.php rename to core/lib/Drupal/Core/EventSubscriber/KernelTerminateSubscriber.php index 74ea845..1906ac3 100644 --- a/core/lib/Drupal/Core/ServiceTerminator.php +++ b/core/lib/Drupal/Core/EventSubscriber/KernelTerminateSubscriber.php @@ -2,10 +2,10 @@ /** * @file - * Contains Drupal\Core\ServiceTerminator. + * Contains Drupal\Core\EventSubscriber\KernelTerminateSubscriber. */ -namespace Drupal\Core; +namespace Drupal\Core\EventSubscriber; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\PostResponseEvent; @@ -15,7 +15,7 @@ /** * This terminates iniated services tagged with needs_termination. */ -class ServiceTerminator implements EventSubscriberInterface { +class KernelTerminateSubscriber implements EventSubscriberInterface { /** * Holds an array of service ID's that will require termination. @@ -25,7 +25,7 @@ class ServiceTerminator implements EventSubscriberInterface { protected $services; /** - * Constructs a ServiceTerminator. + * Constructs a KernelTerminateSubscriber object. * * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * The container object. diff --git a/core/modules/system/lib/Drupal/system/Tests/ServiceTerminator/ServiceTerminatorTest.php b/core/modules/system/lib/Drupal/system/Tests/ServiceTerminator/ServiceTerminatorTest.php index 954b810..c82b49a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/ServiceTerminator/ServiceTerminatorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/ServiceTerminator/ServiceTerminatorTest.php @@ -35,7 +35,7 @@ public function testTermination() { $this->assertNull(state()->get('bundle_test.terminated')); // Get the service terminator. - $service_terminator = $this->container->get('service_terminator'); + $service_terminator = $this->container->get('kernel_terminate_subscriber'); // Simulate a shutdown. The test class has not been called, so it should not // be terminated.