From c2fb90f953e4cdd6431915055250b777cfe4cbcf Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 26 Dec 2012 10:20:15 -0800 Subject: [PATCH] Issue #1872640 by fabpot: Renamed the dispatcher service to event_dispatcher(). --- core/includes/install.core.inc | 4 ++-- core/lib/Drupal/Core/Config/Config.php | 2 +- core/lib/Drupal/Core/CoreBundle.php | 12 ++++-------- .../Compiler/RegisterKernelListenersPass.php | 4 ++-- core/modules/locale/locale.module | 2 +- core/modules/rdf/lib/Drupal/rdf/RdfBundle.php | 2 +- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index ef50d04e0cd..755c2c1ff0a 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -324,12 +324,12 @@ function install_begin_request(&$install_state) { // @todo Move into a proper Drupal\Core\DependencyInjection\InstallContainerBuilder. $container = new ContainerBuilder(); - $container->register('dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher'); + $container->register('event_dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher'); $container->register('config.storage', 'Drupal\Core\Config\InstallStorage'); $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory') ->addArgument(new Reference('config.storage')) - ->addArgument(new Reference('dispatcher')); + ->addArgument(new Reference('event_dispatcher')); drupal_container($container); } diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php index 02ac96162f5..783c6b853f2 100644 --- a/core/lib/Drupal/Core/Config/Config.php +++ b/core/lib/Drupal/Core/Config/Config.php @@ -85,7 +85,7 @@ class Config { public function __construct($name, StorageInterface $storage, EventDispatcher $event_dispatcher = NULL) { $this->name = $name; $this->storage = $storage; - $this->eventDispatcher = $event_dispatcher ? $event_dispatcher : drupal_container()->get('dispatcher'); + $this->eventDispatcher = $event_dispatcher ? $event_dispatcher : drupal_container()->get('event_dispatcher'); } /** diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index 8300fc3de59..3f91b32ae8d 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -49,13 +49,9 @@ class CoreBundle extends Bundle { ->addArgument(new Reference('config.cachedstorage.storage')) ->addArgument(new Reference('cache.config')); - // Register configuration object factory. - $container->register('config.subscriber.globalconf', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber'); - $container->register('dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher') - ->addMethodCall('addSubscriber', array(new Reference('config.subscriber.globalconf'))); $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory') ->addArgument(new Reference('config.storage')) - ->addArgument(new Reference('dispatcher')) + ->addArgument(new Reference('event_dispatcher')) ->addTag('persist'); // Register staging configuration storage. @@ -100,12 +96,12 @@ class CoreBundle extends Bundle { $container->register('request', 'Symfony\Component\HttpFoundation\Request') ->setSynthetic(TRUE); - $container->register('dispatcher', 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher') + $container->register('event_dispatcher', 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher') ->addArgument(new Reference('service_container')); $container->register('resolver', 'Drupal\Core\ControllerResolver') ->addArgument(new Reference('service_container')); $container->register('http_kernel', 'Drupal\Core\HttpKernel') - ->addArgument(new Reference('dispatcher')) + ->addArgument(new Reference('event_dispatcher')) ->addArgument(new Reference('service_container')) ->addArgument(new Reference('resolver')); $container->register('language_manager', 'Drupal\Core\Language\LanguageManager') @@ -134,7 +130,7 @@ class CoreBundle extends Bundle { $container->register('router.builder', 'Drupal\Core\Routing\RouteBuilder') ->addArgument(new Reference('router.dumper')) ->addArgument(new Reference('lock')) - ->addArgument(new Reference('dispatcher')); + ->addArgument(new Reference('event_dispatcher')); $container->register('matcher', 'Drupal\Core\Routing\ChainMatcher'); diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php index e439c674745..e580c3164a3 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php @@ -14,11 +14,11 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; class RegisterKernelListenersPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('dispatcher')) { + if (!$container->hasDefinition('event_dispatcher')) { return; } - $definition = $container->getDefinition('dispatcher'); + $definition = $container->getDefinition('event_dispatcher'); foreach ($container->findTaggedServiceIds('event_subscriber') as $id => $attributes) { diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 9777811dcf7..c8ccc375ba3 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -1307,5 +1307,5 @@ function _locale_rebuild_js($langcode = NULL) { */ function locale_language_init() { // Add locale helper to configuration subscribers. - drupal_container()->get('dispatcher')->addSubscriber(new LocaleConfigSubscriber()); + drupal_container()->get('event_dispatcher')->addSubscriber(new LocaleConfigSubscriber()); } diff --git a/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php b/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php index 258ab6d6591..40affccbbf0 100644 --- a/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php +++ b/core/modules/rdf/lib/Drupal/rdf/RdfBundle.php @@ -31,7 +31,7 @@ class RdfBundle extends Bundle { ->addArgument(new Reference('cache.rdf.site_schema.types')); // Mapping manager service. $container->register('rdf.mapping_manager', 'Drupal\rdf\RdfMappingManager') - ->addArgument(new Reference('dispatcher')) + ->addArgument(new Reference('event_dispatcher')) ->addArgument(new Reference('rdf.site_schema_manager')); // Mapping subscriber.