function _drush_config_import

8.0.x _drush_config_import(StorageComparer $storage_comparer)
7.x _drush_config_import(StorageComparer $storage_comparer)
master _drush_config_import(StorageComparer $storage_comparer)
1 string reference to '_drush_config_import'
drush_config_import in commands/core/
Command callback. Import from specified config directory (defaults to sync).


commands/core/, line 698
Provides Configuration Management commands.


function _drush_config_import(StorageComparer $storage_comparer) {
  $config_importer = new ConfigImporter($storage_comparer, \Drupal::service('event_dispatcher'), \Drupal::service('config.manager'), \Drupal::lock(), \Drupal::service('config.typed'), \Drupal::moduleHandler(), \Drupal::service('module_installer'), \Drupal::service('theme_handler'), \Drupal::service('string_translation'));
  if ($config_importer->alreadyImporting()) {
    drush_log('Another request may be synchronizing configuration already.', LogLevel::WARNING);
  else {
    try {
      drush_log('The configuration was imported successfully.', LogLevel::SUCCESS);
    catch (ConfigException $e) {
      // Return a negative result for UI purposes. We do not differentiate
      // between an actual synchronization error and a failed lock, because
      // concurrent synchronizations are an edge-case happening only when
      // multiple developers or site builders attempt to do it without
      // coordinating.
      $message = 'The import failed due for the following reasons:' . "\n";
      $message .= implode("\n", $config_importer->getErrors());

      watchdog_exception('config_import', $e);
      return drush_set_error('config_import_fail', $message);