1.12.x config.sync.inc _config_sync_finished($status, $results, $operations)
1.10.x config.sync.inc _config_sync_finished($status, $results, $operations)
1.11.x config.sync.inc _config_sync_finished($status, $results, $operations)
1.7.x config.sync.inc _config_sync_finished($status, $results, $operations)
1.8.x config.sync.inc _config_sync_finished($status, $results, $operations)
1.9.x config.sync.inc _config_sync_finished($status, $results, $operations)

Batch API callback. Finish the config import.

File

modules/config/config.sync.inc, line 93

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']))));

    // 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');
}