public function SystemConfigSubscriber::onConfigImporterValidate

File

drupal/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php, line 31
Contains \Drupal\system\SystemConfigSubscriber.

Class

SystemConfigSubscriber
System Config subscriber.

Namespace

Drupal\system

Code

public function onConfigImporterValidate(ConfigImporterEvent $event) {
  $importer = $event
    ->getConfigImporter();
  $importList = $importer
    ->getStorageComparer()
    ->getSourceStorage()
    ->listAll();
  if (empty($importerList)) {
    throw new ConfigImporterException("This import will delete all your active configuration, I'm bailing out now.");
  }
}