function config_sync_changes

Writes an array of config file changes from a source storage to a target storage.

Parameters

array $config_changes: An array of changes to be written.

Drupal\Core\Config\StorageInterface $source_storage: The storage to synchronize configuration from.

Drupal\Core\Config\StorageInterface $target_storage: The storage to synchronize configuration to.

3 calls to config_sync_changes()
config_import in drupal/core/includes/config.inc
Imports configuration into the active configuration.
config_install_default_config in drupal/core/includes/config.inc
Installs the default configuration of a given extension.
ViewTestData::importTestViews in drupal/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php
Imports test views from config.

File

drupal/core/includes/config.inc, line 181
This is the API for configuration storage.

Code

function config_sync_changes(array $config_changes, StorageInterface $source_storage, StorageInterface $target_storage) {
  foreach (array(
    'delete',
    'create',
    'change',
  ) as $op) {
    foreach ($config_changes[$op] as $name) {
      if ($op == 'delete') {
        $target_storage
          ->delete($name);
      }
      else {
        $data = $source_storage
          ->read($name);
        $target_storage
          ->write($name, $data);
      }
    }
  }
}