class ConfigSubscriber in Zircon Profile 8
Same name in this branch
- 8 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber
- 8 core/modules/language/src/EventSubscriber/ConfigSubscriber.php \Drupal\language\EventSubscriber\ConfigSubscriber
Same name and namespace in other branches
- 8.0 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber
Config subscriber.
Hierarchy
- class \Drupal\Core\Config\ConfigImportValidateEventSubscriberBase implements EventSubscriberInterface uses StringTranslationTrait
- class \Drupal\config\ConfigSubscriber
Expanded class hierarchy of ConfigSubscriber
1 string reference to 'ConfigSubscriber'
- config.services.yml in core/
modules/ config/ config.services.yml - core/modules/config/config.services.yml
1 service uses ConfigSubscriber
- config.config_subscriber in core/
modules/ config/ config.services.yml - Drupal\config\ConfigSubscriber
File
- core/
modules/ config/ src/ ConfigSubscriber.php, line 18 - Contains \Drupal\config\ConfigSubscriber.
Namespace
Drupal\configView source
class ConfigSubscriber extends ConfigImportValidateEventSubscriberBase {
/**
* Checks that the Configuration module is not being uninstalled.
*
* @param ConfigImporterEvent $event
* The config import event.
*/
public function onConfigImporterValidate(ConfigImporterEvent $event) {
$importer = $event
->getConfigImporter();
$core_extension = $importer
->getStorageComparer()
->getSourceStorage()
->read('core.extension');
if (!isset($core_extension['module']['config'])) {
$importer
->logError($this
->t('Can not uninstall the Configuration module as part of a configuration synchronization through the user interface.'));
}
}
/**
* {@inheritdoc}
*/
static function getSubscribedEvents() {
$events[ConfigEvents::IMPORT_VALIDATE][] = array(
'onConfigImporterValidate',
20,
);
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigSubscriber:: |
static | function |
Returns an array of event names this subscriber wants to listen to. Overrides ConfigImportValidateEventSubscriberBase:: |
|
ConfigSubscriber:: |
public | function |
Checks that the Configuration module is not being uninstalled. Overrides ConfigImportValidateEventSubscriberBase:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |