diff --git a/core/lib/Drupal/Core/Config/Context/ConfigContext.php b/core/lib/Drupal/Core/Config/Context/ConfigContext.php index 9be0f71..8efc9ec 100644 --- a/core/lib/Drupal/Core/Config/Context/ConfigContext.php +++ b/core/lib/Drupal/Core/Config/Context/ConfigContext.php @@ -15,18 +15,12 @@ /** * Defines the base configuration context object. * - * A configuration context object provides a data array that can be used: - * - as a parameter to get customized configuration objects. - * - as a store of config data used to override values. + * A configuration context object provides a data array that can be used + * as parameters to get customized configuration objects. */ class ConfigContext implements ContextInterface { /** - * Predefined key, values to override specific configuration objects. - */ - const OVERRIDE = 'config.override'; - - /** * The actual storage of key-value pairs. * * @var array @@ -85,20 +79,6 @@ public function set($key, $value) { } /** - * Sets override data. - * - * @param mixed $data - * Override data to store. - * - * @return \Drupal\Core\Config\Context\ConfigContext - * The config context object. - */ - public function setOverride($data) { - $this->init(self::OVERRIDE, $data); - return $this; - } - - /** * Implements Drupal\Core\Config\Context\ContextInterface::setUuid(). */ public function setUuid() { diff --git a/core/lib/Drupal/Core/Config/Context/GlobalConfigContext.php b/core/lib/Drupal/Core/Config/Context/GlobalConfigContext.php deleted file mode 100644 index 9e8fa1e..0000000 --- a/core/lib/Drupal/Core/Config/Context/GlobalConfigContext.php +++ /dev/null @@ -1,29 +0,0 @@ -init(self::OVERRIDE, $conf); - return $this; - } -} diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index 6f7ff31..0f0a108 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -58,9 +58,7 @@ public function build(ContainerBuilder $container) { $container->register('config.context', 'Drupal\Core\Config\Context\ContextInterface') ->setFactoryService(new Reference('config.context.factory')) ->setFactoryMethod('get') - ->addArgument('Drupal\Core\Config\Context\GlobalConfigContext') - ->addTag('persist') - ->addMethodCall('setGlobalOverride'); + ->addTag('persist'); // Register a config context with no overrides for use in administration // forms, enabling modules and importing configuration. @@ -278,7 +276,7 @@ public function build(ContainerBuilder $container) { $container->register('request_close_subscriber', 'Drupal\Core\EventSubscriber\RequestCloseSubscriber') ->addArgument(new Reference('module_handler')) ->addTag('event_subscriber'); - $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigOverrideSubscriber') + $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber') ->addTag('event_subscriber'); $container->register('language_request_subscriber', 'Drupal\Core\EventSubscriber\LanguageRequestSubscriber') ->addArgument(new Reference('language_manager')) diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php new file mode 100644 index 0000000..b2aa76e --- /dev/null +++ b/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php @@ -0,0 +1,40 @@ +getConfig(); + if (isset($conf[$config->getName()])) { + $config->setOverride($conf[$config->getName()]); + } + } + + /** + * Implements EventSubscriberInterface::getSubscribedEvents(). + */ + static function getSubscribedEvents() { + $events['config.init'][] = array('configInit', 30); + return $events; + } +} diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php deleted file mode 100644 index 376da10..0000000 --- a/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php +++ /dev/null @@ -1,41 +0,0 @@ -getContext()->get(ConfigContext::OVERRIDE)) { - $config = $event->getConfig(); - if (isset($override[$config->getName()])) { - $config->setOverride($override[$config->getName()]); - } - } - } - - /** - * Implements EventSubscriberInterface::getSubscribedEvents(). - */ - public static function getSubscribedEvents() { - $events['config.init'][] = array('configInit', 30); - return $events; - } -}