You are here

class ConfigSubscriber in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber
  2. 8 core/modules/language/src/EventSubscriber/ConfigSubscriber.php \Drupal\language\EventSubscriber\ConfigSubscriber
Same name and namespace in other branches
  1. 8.0 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber

Config subscriber.

Hierarchy

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\config
View 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

Namesort descending Modifiers Type Description Overrides
ConfigSubscriber::getSubscribedEvents static function Returns an array of event names this subscriber wants to listen to. Overrides ConfigImportValidateEventSubscriberBase::getSubscribedEvents
ConfigSubscriber::onConfigImporterValidate public function Checks that the Configuration module is not being uninstalled. Overrides ConfigImportValidateEventSubscriberBase::onConfigImporterValidate
StringTranslationTrait::$stringTranslation protected property The string translation service.
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.