1 config.sync.inc _config_sync_finished($status, $results, $operations)

Batch API callback. Finish the config import.

File

core/modules/config/config.sync.inc, line 92

Code

function _config_sync_finished($status, $results, $operations) {
  if ($status === FALSE) {
    backdrop_set_message(t('Configuration sync failed. Check that the configuration files are properly formatted.'), 'error');
  }
  if (!empty($results['errors'])) {
    backdrop_set_message(t('Configuration sync failed. The following errors were reported:') . ' ' . theme('item_list', array('items' => $results['errors'])), 'error');
  }
  if (!empty($results['completed_changes'])) {
    backdrop_set_message(t('Configuration sync completed. @files configuration files synced.', array('@files' => count($results['completed_changes']))));
    if (config_get('system.core', 'config_sync_clear_staging')) {
      // Clean up the staging directory.
      $config_dir = config_get_config_directory('staging');
      $config_storage = new ConfigFileStorage($config_dir);
      $config_storage->deleteAll();
    }
  }
  backdrop_flush_all_caches();
  state_del('config_sync');
}