Defines a configuration global override for contexts.
Expanded class hierarchy of ConfigGlobalOverrideSubscriber
class ConfigGlobalOverrideSubscriber implements EventSubscriberInterface {
/**
* Overrides configuration values with values in global $conf variable.
*
* @param \Drupal\Core\Config\ConfigEvent $event
* The Event to process.
*/
public function configInit(ConfigEvent $event) {
global $conf;
$config = $event
->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;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigGlobalOverrideSubscriber:: |
public | function | Overrides configuration values with values in global $conf variable. | |
ConfigGlobalOverrideSubscriber:: |
static | function |
Implements EventSubscriberInterface::getSubscribedEvents(). Overrides EventSubscriberInterface:: |