You are here

function configuration_check_changed in Configuration Management 7

Check components on datastore to see if there are any changes that would be lost as a result of rewriting them.

Parameters

$changed A Bitmask to check config status against:

$components An array of components to check:

$config An array of configurations to check components in:

3 calls to configuration_check_changed()
configuration_delete_multiple in ./configuration.module
Delete a specific configuration from being tracked.
configuration_save in ./configuration.module
Save changes to track configuration.
configuration_write_exports in ./configuration.export.inc
Writes configurations to disk.

File

./configuration.export.inc, line 898

Code

function configuration_check_changed($changed, $components, $config = NULL) {
  $config = is_null($config) ? configuration_get_configuration() : $config;

  // Do not write the export file if the datastore is different
  foreach ($components as $component) {
    if (array_key_exists($component, $config)) {
      foreach ($config[$component] as $info) {
        if ($info['status'] & $changed) {
          drupal_set_message(t('Unable to write exports. Your datastore has configs that would be lost in %component.', array(
            '%component' => $component,
          )), 'error');
          return FALSE;
        }
      }
    }
  }
  return TRUE;
}