Mercurial > hg > isophonics-drupal-site
view core/modules/config/src/ConfigSubscriber.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 7a779792577d |
children | c2387f117808 |
line wrap: on
line source
<?php namespace Drupal\config; use Drupal\Core\Config\ConfigEvents; use Drupal\Core\Config\ConfigImporterEvent; use Drupal\Core\Config\ConfigImportValidateEventSubscriberBase; /** * Config subscriber. */ class ConfigSubscriber extends ConfigImportValidateEventSubscriberBase { /** * Checks that the Configuration module is not being uninstalled. * * @param \Drupal\Core\Config\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} */ public static function getSubscribedEvents() { $events[ConfigEvents::IMPORT_VALIDATE][] = ['onConfigImporterValidate', 20]; return $events; } }