View source
<?php
define('CONFIGURATION_IN_SYNC', 0x0);
define('CONFIGURATION_ACTIVESTORE_OVERRIDDEN', 0x1);
define('CONFIGURATION_DATASTORE_OVERRIDDEN', 0x2);
define('CONFIGURATION_CONFLICT', CONFIGURATION_ACTIVESTORE_OVERRIDDEN | CONFIGURATION_DATASTORE_OVERRIDDEN);
define('CONFIGURATION_TRACKED_DATASTORE_ONLY', 0x4);
define('CONFIGURATION_DATASTORE_ONLY', 0x8);
define('CONFIGURATION_DELETE', 0x10);
define('CONFIGURATION_DEPENDENCY_REQUIRED', 0x100);
define('CONFIGURATION_OVERRIDDEN', CONFIGURATION_ACTIVESTORE_OVERRIDDEN | CONFIGURATION_DATASTORE_OVERRIDDEN);
define('CONFIGURATION_MODULE_ENABLED', 1);
define('CONFIGURATION_MODULE_DISABLED', 0);
define('CONFIGURATION_MODULE_MISSING', -1);
define('CONFIGURATION_REBUILDABLE', -1);
define('CONFIGURATION_NEEDS_REVIEW', 2);
define('CONFIGURATION_REBUILDING', 3);
define('CONFIGURATION_DISABLED', 5);
define('CONFIGURATION_SEMAPHORE_TIMEOUT', 10 * 60);
define('CONFIGURATION_DEFAULTS_INCLUDED_COMMON', 0);
define('CONFIGURATION_DEFAULTS_INCLUDED', 1);
define('CONFIGURATION_DEFAULTS_CUSTOM', 2);
define('CONFIGURATION_DUPLICATES_CONFLICT', 0);
define('CONFIGURATION_DUPLICATES_ALLOWED', 1);
function configuration_menu() {
$items['admin/config/system/configuration'] = array(
'title' => 'Configuration Management',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'configuration_tracking_form',
),
'access arguments' => array(
'access configuration management',
),
'description' => 'Configuration Management for Drupal 7',
'type' => MENU_NORMAL_ITEM,
'file' => 'configuration.admin.inc',
);
$items['admin/config/system/configuration/tracking'] = array(
'title' => 'Tracking',
'weight' => -1,
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/config/system/configuration/notracking'] = array(
'title' => 'Not tracking',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'configuration_notracking_form',
),
'access arguments' => array(
'access configuration management',
),
'type' => MENU_LOCAL_TASK,
'file' => 'configuration.admin.inc',
);
$items['admin/config/system/configuration/migrate'] = array(
'title' => 'Migrate',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'configuration_migrate_form',
),
'access arguments' => array(
'access configuration management',
),
'type' => MENU_LOCAL_TASK,
'file' => 'configuration.admin.inc',
'weight' => 7,
);
$items['admin/config/system/configuration/migrate/export'] = array(
'title' => 'Export',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 8,
);
$items['admin/config/system/configuration/migrate/import'] = array(
'title' => 'Import',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'configuration_import_form',
),
'access arguments' => array(
'access configuration management',
),
'type' => MENU_LOCAL_TASK,
'file' => 'configuration.admin.inc',
'weight' => 9,
);
$items['admin/config/system/configuration/settings'] = array(
'title' => 'Settings',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'configuration_settings_form',
),
'access arguments' => array(
'access configuration management',
),
'type' => MENU_LOCAL_TASK,
'file' => 'configuration.admin.inc',
'weight' => 10,
);
$items['admin/config/system/configuration/config/%/%/delete'] = array(
'title' => 'Are you sure you want to stop tracking this config?',
'page callback' => 'configuration_confirm_delete_page',
'access arguments' => array(
'access configuration management',
),
'file' => 'configuration.admin.inc',
'page arguments' => array(
5,
6,
),
);
if (module_exists('diff')) {
$items['admin/config/system/configuration/%/%/diff'] = array(
'title' => 'Review overrides',
'description' => 'Compare activestore and datastore.',
'page callback' => 'configuration_diff',
'page arguments' => array(
4,
5,
),
'access arguments' => array(
'access configuration management',
),
'file' => 'configuration.admin.inc',
);
}
return $items;
}
function configuration_permission() {
return array(
'access configuration management' => array(
'title' => t('Administer Configuration Management'),
'description' => t('Administer the exports and activation of configuration.'),
),
);
}
function configuration_theme($existing, $type, $theme, $path) {
$base = array(
'path' => drupal_get_path('module', 'configuration') . '/theme',
'file' => 'theme.inc',
);
$items = array();
$items['configuration_form_buttons'] = array(
'render element' => 'element',
) + $base;
return $items;
}
function configuration_stream_wrappers() {
return array(
'config' => array(
'name' => t('Configuration files'),
'class' => 'ConfigurationStreamWrapper',
'description' => t('Configuration files export directory.'),
'type' => STREAM_WRAPPERS_LOCAL_HIDDEN,
),
);
}
function configuration_init() {
if (arg(0) == 'admin' && variable_get('configuration_display_messages', TRUE) && empty($_POST)) {
$overridden = configuration_get_configuration('overridden');
if (user_access('access configuration management') && $overridden !== 0) {
if ($overridden | (CONFIGURATION_ACTIVESTORE_OVERRIDDEN | CONFIGURATION_DATASTORE_OVERRIDDEN)) {
drupal_set_message(t('Configurations are out of sync and need to be either !write.', array(
'!write' => l(t('activated or written to file'), 'admin/config/system/configuration/tracking'),
)), 'warning', FALSE);
}
elseif ($overridden & CONFIGURATION_DATASTORE_ONLY) {
drupal_set_message(t('You have new Configurations that need to be activated. !click_here to activate your configurations.', array(
'!click_here' => l(t('Click here'), 'admin/config/system/configuration/activate'),
)), 'warning', FALSE);
}
elseif ($overridden == CONFIGURATION_CONFLICT) {
drupal_set_message(t('You have conflicts with your Configurations. Activating configurations will overwrite what is in the activestore, or you can write what is in the activestore back to datastore. !click_here to resolve.', array(
'!click_here' => l(t('Click here'), 'admin/config/system/configuration/activate'),
)), 'error', FALSE);
}
}
}
}
function hook_modules_enabled($modules) {
if (in_array('diff', $modules)) {
drupal_flush_all_caches();
}
}
function configuration_get_components($configuration_source = FALSE, $reset = FALSE) {
configuration_include();
static $components_all;
static $components_source;
if (!isset($components_all) || $reset) {
$components_all = $components_source = array();
foreach (module_implements('configuration_api') as $module) {
$info = module_invoke($module, 'configuration_api');
foreach ($info as $k => $v) {
$components_all[$k] = $v;
if (!empty($v['configuration_source'])) {
$components_source[$k] = $v;
}
}
}
}
return $configuration_source ? $components_source : $components_all;
}
function configuration_include($reset = FALSE) {
static $once;
if (!isset($once) || $reset) {
$once = TRUE;
foreach (module_implements('configuration_api') as $module) {
$info = module_invoke($module, 'configuration_api');
foreach ($info as $component) {
if (isset($component['file'])) {
require_once DRUPAL_ROOT . '/' . $component['file'];
}
}
}
$modules = array(
'configuration',
'block',
'context',
'field',
'filter',
'image',
'menu',
'node',
'taxonomy',
'user',
'views',
'ctools',
);
foreach (array_filter($modules, 'module_exists') as $module) {
if (!module_hook($module, 'configuration_api')) {
module_load_include('inc', 'configuration', "includes/configuration.{$module}");
}
}
module_implements('configuration_api', FALSE, TRUE);
}
}
function configuration_include_defaults($components = NULL, $reset = FALSE) {
static $included = array();
static $include_components;
if (!isset($include_components) || $reset) {
$include_components = configuration_get_components();
foreach ($include_components as $component => $info) {
if ($component !== 'views' && !isset($info['api']) && (!isset($info['default_file']) || $info['default_file'] !== CONFIGURATION_DEFAULTS_INCLUDED)) {
unset($include_components[$component]);
}
}
}
if (isset($components)) {
$components = is_array($components) ? $components : array(
$components => $components,
);
}
else {
$components = $include_components;
}
foreach (array_keys($components) as $component) {
if (isset($include_components[$component]) && (!isset($included[$component]) || $reset)) {
$info = $include_components[$component];
if ($component === 'views') {
views_include('view');
views_include_handlers();
views_module_include('views_default.inc');
}
elseif (isset($info['api'], $info['module'], $info['current_version'])) {
ctools_include('plugins');
ctools_plugin_api_include($info['module'], $info['api'], $info['current_version'], $info['current_version']);
$file = 'config://configuration.' . $component . '.inc';
if (is_file($file)) {
include_once drupal_realpath($file);
}
}
else {
$file = "config://configuration.{$component}.inc";
if (is_file($file)) {
include_once drupal_realpath($file);
}
}
$included[$component] = TRUE;
}
}
$file = "config://configuration.inc";
if (is_file($file)) {
include_once drupal_realpath($file);
}
}
function configuration_get_configurations($name = NULL, $reset = FALSE) {
return configuration_get_info('configuration', $name, $reset);
}
function configuration_get_info($type = 'module', $name = NULL, $reset = FALSE) {
static $cache;
if (!isset($cache)) {
$cache = cache_get('configuration_module_info');
}
if (empty($cache) || $reset) {
$data = array();
$ignored = variable_get('configuration_ignored_orphans', array());
$files = system_rebuild_module_data();
foreach ($files as $row) {
if (in_array($row->name, $ignored, TRUE) && !$row->status) {
$key = array_search($row->name, $ignored, TRUE);
unset($ignored[$key]);
}
if (!empty($row->info['configuration'])) {
if (!empty($row->info['stylesheets'])) {
foreach ($row->info['stylesheets'] as $media => $css) {
$row->info['stylesheets'][$media] = array_keys($css);
}
}
if (!empty($row->info['scripts'])) {
$row->info['scripts'] = array_keys($row->info['scripts']);
}
$data['configuration'][$row->name] = $row;
}
$data['module'][$row->name] = $row;
}
$required = array();
$non_required = array();
$sorted = array();
foreach ($required + $non_required as $module => $weight) {
$sorted[$module] = $data['configuration'][$module];
}
$data['configuration'] = $sorted;
variable_set('configuration_ignored_orphans', $ignored);
cache_set("configuration_module_info", $data);
$cache = new stdClass();
$cache->data = $data;
}
if (!empty($name)) {
return !empty($cache->data[$type][$name]) ? clone $cache->data[$type][$name] : array();
}
return !empty($cache->data[$type]) ? $cache->data[$type] : array();
}
function configuration_load($name, $reset = FALSE) {
return configuration_get_configuration($name, $reset);
}
function configuration_get_modules($name = NULL, $reset = FALSE) {
return configuration_get_info('module', $name, $reset);
}
function configuration_invoke($component, $callback) {
$args = func_get_args();
unset($args[0], $args[1]);
$args[] = $component;
if ($function = configuration_hook($component, $callback)) {
return call_user_func_array($function, $args);
}
}
function configuration_hook($component, $hook, $reset = FALSE) {
$info =& drupal_static(__FUNCTION__);
if (!isset($info) || $reset) {
$info = module_invoke_all('configuration_api');
}
$base = isset($info[$component]['base']) ? $info[$component]['base'] : $component;
return function_exists($base . '_' . $hook) ? $base . '_' . $hook : FALSE;
}
function configuration_save($configs) {
configuration_include();
module_load_include('inc', 'configuration', 'configuration.export');
$current_config = configuration_get_configuration();
if (!configuration_check_changed(CONFIGURATION_DATASTORE_ONLY, array_keys($configs), $current_config)) {
return FALSE;
}
try {
$transaction = db_transaction();
$saved = array();
foreach ($configs as $component => $config) {
foreach ($config as $name => $on) {
if ($on) {
$deps = is_numeric($on) || $on == '' ? array(
'parent' => '',
'modules' => '',
) : $on;
$function = "configuration_hash_{$component}";
$hash = $function($name);
$record = array(
'name' => $name,
'owner' => $component,
'status' => CONFIGURATION_IN_SYNC,
'hash' => $hash,
'parent' => $deps['parent'],
'dependencies' => $deps['modules'],
);
if (!isset($saved[$component])) {
$saved[$component] = TRUE;
}
$pk = isset($current_config[$component][$name]) ? array(
'name',
) : array();
drupal_write_record('config_export', $record, $pk);
$configs[$component][$name] = $name;
}
else {
unset($configs[$component][$name]);
}
}
if (isset($saved[$component])) {
drupal_set_message(t('Tracking configurations for %config have been saved.', array(
'%config' => $component,
)));
}
}
cache_clear_all('config_export', 'cache');
} catch (Exception $e) {
$transaction
->rollback();
watchdog_exception('configuration', $e);
throw $e;
}
configuration_write_exports(array_keys($saved));
}
function configuration_delete($cid) {
configuration_delete_multiple(array(
$cid,
));
}
function configuration_delete_multiple($cids) {
module_load_include('inc', 'configuration', 'configuration.export');
$transaction = db_transaction();
try {
$names = db_query("SELECT name, owner FROM {config_export} WHERE cid IN (" . join(',', $cids) . ")")
->fetchAll();
foreach ($names as $name) {
$exclude[$name->name] = $name->owner;
$config[$name->owner] = array(
$name->name => array(),
);
}
$config_populate = configuration_populate_sanitize($config);
$export = configuration_populate($config_populate, array());
_configuration_track_dependencies($export);
$config = array_key_exists('configuration_dependency', $export) ? array_merge($config, $export['configuration_dependency']['configuration']) : $config;
if (array_key_exists('configuration_dependency', $export) && !configuration_check_changed(CONFIGURATION_ACTIVESTORE_OVERRIDDEN, array_keys($export['configuration_dependency']['configuration']))) {
drupal_get_messages();
drupal_set_message(t('Unable to stop tracking. Dependent configurations that are overridden in the activestore would be written to file. Write configurations in %component component(s) first, then try again.', array(
'%component' => join(', ', array_keys($export['configuration_dependency']['configuration'])),
)), 'error');
return FALSE;
}
if (!configuration_check_changed(CONFIGURATION_DATASTORE_ONLY | CONFIGURATION_DATASTORE_OVERRIDDEN, array_keys($config))) {
drupal_get_messages();
drupal_set_message(t('Unable to stop tracking. Configs would be lost when rewriting %component config file. Activate configurations in %component component(s) first, then try again.', array(
'%component' => join(', ', array_keys($config)),
)), 'error');
return FALSE;
}
$files = configuration_export_render($export);
foreach (array_keys($files) as $filename) {
unlink("config://" . $filename . '.inc');
watchdog('configuration', 'Deleted %file for rewrite.', array(
'%file' => $filename . '.inc',
));
}
db_update('config_export')
->fields(array(
'status' => CONFIGURATION_DELETE,
))
->condition('cid', $cids, 'IN')
->execute();
cache_clear_all('config_export', 'cache');
configuration_write_exports(array_keys($config), $exclude);
db_delete('config_export')
->condition('cid', $cids, 'IN')
->execute();
db_update('config_export')
->fields(array(
'parent' => '',
))
->condition('parent', array_keys($exclude), 'IN')
->execute();
cache_clear_all('config_export', 'cache');
} catch (Exception $e) {
$transaction
->rollback();
watchdog_exception('configuration', $e);
throw $e;
}
return TRUE;
}
function configuration_add_status($component, $name, $hash) {
$current_config = configuration_get_configuration();
$record = array(
'name' => $name,
'owner' => $component,
'status' => CONFIGURATION_DATASTORE_ONLY,
'hash' => $hash,
);
drupal_write_record('config_export', $record);
cache_clear_all('config_export', 'cache');
}
function configuration_set_status($component, $name, $status) {
db_update('config_export')
->fields(array(
'status' => $status,
))
->condition('name', $name)
->condition('owner', $component)
->execute();
}
function configuration_set_hash($component, $name, $hash) {
db_update('config_export')
->fields(array(
'hash' => $hash,
))
->condition('name', $name)
->condition('owner', $component)
->execute();
}
function configuration_get_status($component, $name) {
$config = configuration_get_configuration();
return $config[$component][$name]['status'];
}
function configuration_populate_sanitize($config) {
$sanitized = array();
foreach ($config as $component => $value) {
if (is_array($value)) {
foreach ($value as $name => $settings) {
$sanitized[$component][$name] = $name;
}
}
}
return $sanitized;
}
function configuration_get_configuration($component = NULL) {
$from_activestore =& drupal_static('configuration_from_activestore');
if (!($cache = cache_get('config_export'))) {
$config = configuration_build_configuration_status();
if (!$from_activestore) {
configuration_check_configurations();
$config = configuration_build_configuration_status();
}
return isset($component) && isset($config[$component]) ? $config[$component] : $config;
}
return isset($component) && isset($cache->data[$component]) ? $cache->data[$component] : $cache->data;
}
function configuration_build_configuration_status() {
$result = db_query("SELECT name, owner, status, hash, parent, dependencies FROM {config_export} WHERE status <> :status ORDER BY owner, name", array(
':status' => CONFIGURATION_DELETE,
))
->fetchAll();
$config = array(
'overridden' => 0,
);
foreach ($result as $comp) {
$config[$comp->owner][$comp->name] = array(
'status' => $comp->status,
'hash' => $comp->hash,
'parent' => $comp->parent,
'dependencies' => $comp->dependencies,
);
if ($comp->status & CONFIGURATION_ACTIVESTORE_OVERRIDDEN) {
$config['overridden'] = $config['overridden'] | $comp->status;
}
elseif ($comp->status & CONFIGURATION_DATASTORE_OVERRIDDEN) {
$config['overridden'] = $config['overridden'] | $comp->status;
}
elseif ($comp->status & CONFIGURATION_DATASTORE_ONLY) {
$config['overridden'] = $config['overridden'] | $comp->status;
}
}
cache_set('config_export', $config);
return $config;
}
function _configuration_restore($op, $items = array(), $module_name = 'configuration') {
module_load_include('inc', 'configuration', 'configuration.export');
configuration_include();
switch ($op) {
case 'revert':
$restore_hook = 'configuration_revert';
$log_action = 'Revert';
break;
case 'rebuild':
$restore_hook = 'configuration_rebuild';
$log_action = 'Rebuild';
break;
case 'disable':
$restore_hook = 'configuration_disable_configuration';
$log_action = 'Disable';
break;
case 'enable':
$restore_hook = 'configuration_enable_configuration';
$log_action = 'Enable';
break;
}
if (empty($items)) {
$states = configuration_get_component_states(array(), $op == 'rebuild', defined('DRUSH_BASE_PATH'));
foreach ($states as $module_name => $components) {
foreach ($components as $component => $state) {
if (in_array($state, $restore_states)) {
$items[$module_name][] = $component;
}
}
}
}
foreach ($items as $component => $checked) {
if (configuration_hook($component, $restore_hook)) {
$selected = array_filter($checked);
watchdog('configuration', '@actioning @module_name / @component.', array(
'@action' => $log_action,
'@component' => $component,
'@module_name' => $module_name,
));
configuration_semaphore('set', $component);
configuration_invoke($component, $restore_hook, array_keys($selected), $module_name);
configuration_semaphore('del', $component);
configuration_set_signature($module_name, $component);
watchdog('configuration', '@action completed for @module_name / @component.', array(
'@action' => $log_action,
'@component' => $component,
'@module_name' => $module_name,
));
}
}
}
function configuration_revert($revert = array(), $module_name = 'configuration') {
return _configuration_restore('revert', $revert, $module_name);
}
function configuration_rebuild($rebuild = array()) {
return _configuration_restore('rebuild', $rebuild);
}
function configuration_disable_configuration($module) {
$configuration = configuration_load($module);
$items[$module] = array_keys($configuration->info['configuration']);
return _configuration_restore('disable', $items);
}
function configuration_enable_configuration($module) {
$configuration = configuration_load($module);
$items[$module] = array_keys($configuration->info['configuration']);
return _configuration_restore('enable', $items);
}
function configuration_is_tracked($component, $name) {
$config = configuration_get_configuration();
if (isset($config[$component][$name])) {
return TRUE;
}
return FALSE;
}
function configuration_check_configurations($reset = FALSE) {
if ($reset) {
cache_clear_all('config_export', 'cache');
}
module_load_include('inc', 'configuration', 'configuration.export');
configuration_include();
$config = configuration_get_configuration();
foreach ($config as $component => $info) {
if (is_array($info)) {
foreach ($info as $name => $settings) {
$function = "configuration_check_{$component}";
if (function_exists($function)) {
call_user_func_array($function, array(
$name,
));
}
else {
drupal_set_message(t('Unable to process %component. You may have an unmet dependency. Enable the required modules to track this component.', array(
'%component' => $component,
)), 'warning', FALSE);
}
}
}
}
if ($reset) {
_configuration_write_export_table();
cache_clear_all('config_export', 'cache');
}
configuration_find_new();
}
function _configuration_write_export_table() {
$config_export = drupal_parse_info_file("config://config.export");
$cids = array();
if (isset($config_export['config']) && is_array($config_export['config'])) {
foreach ($config_export['config'] as $component => $config) {
foreach ($config as $identifier => $info) {
$row = db_query("SELECT cid, name, status, hash FROM {config_export} WHERE name = :name AND owner = :owner", array(
':name' => $identifier,
':owner' => $component,
))
->fetchObject();
if (!is_object($row)) {
$record = array(
'name' => $identifier,
'owner' => $component,
'status' => CONFIGURATION_TRACKED_DATASTORE_ONLY,
'hash' => $info['hash'],
'parent' => $info['parent'],
'dependencies' => $info['dependencies'],
);
drupal_write_record('config_export', $record);
$cids[] = $record['cid'];
continue;
}
$cids[] = $row->cid;
if ($info['hash'] && $info['hash'] != $row->hash) {
db_update('config_export')
->fields(array(
'hash' => 'changed-configuration',
'parent' => $info['parent'],
'dependencies' => $info['dependencies'],
'status' => CONFIGURATION_DATASTORE_OVERRIDDEN,
))
->condition('cid', $row->cid)
->execute();
}
}
}
$old_config = db_select('config_export', 'c')
->fields('c');
$removed = db_delete('config_export');
if (!empty($cids)) {
$old_config
->condition('cid', $cids, 'NOT IN');
$removed
->condition('cid', $cids, 'NOT IN');
}
$old_config = $old_config
->execute()
->fetchAll();
$removed = $removed
->execute();
foreach ($old_config as $old) {
$removed_configs[] = $old->name;
}
if ($removed) {
drupal_set_message(t('Removed %num configuration(s). No Longer tracking %config. Not found in datastore.', array(
'%num' => $removed,
'%config' => join(', ', $removed_configs),
)));
}
}
}
function configuration_find_new() {
static $identifiers = array();
$config = configuration_get_configuration();
configuration_include_defaults();
$components = configuration_get_components();
unset($components['ctools']);
foreach ($components as $component => $info) {
$function = "configuration_{$info['default_hook']}";
if (function_exists($function)) {
$code = call_user_func($function);
if (is_array($code)) {
foreach (array_keys($code) as $name) {
if (!in_array($name, $identifiers) && (!isset($config[$component]) || !in_array($name, array_keys($config[$component])))) {
$identifiers[] = $name;
configuration_add_status($component, $name, md5(serialize($code[$name])));
}
}
}
}
}
}
function configuration_log($message, $severity = 'status') {
if (function_exists('drush_verify_cli')) {
$message = strip_tags($message);
if ($severity == 'status') {
$severity = 'ok';
}
elseif ($severity == 'error') {
drush_set_error($message);
return;
}
drush_log($message, $severity);
return;
}
drupal_set_message($message, $severity, FALSE);
}
function configuration_hook_info() {
$hooks['configuration_api'] = array(
'group' => 'configuration',
);
return $hooks;
}
function configuration_update_component_status($component, $identifier, $items, $items_code, $from_activestore) {
$config = configuration_get_configuration();
$status = (int) $config[$component][$identifier]['status'];
$md5_datastore = is_array($items_code) && array_key_exists($identifier, $items_code) ? md5(serialize($items_code[$identifier])) : '';
$md5_activestore = is_array($items) && array_key_exists($identifier, $items) ? md5(serialize($items[$identifier])) : '';
$from_activestore = $md5_activestore != $config[$component][$identifier]['hash'];
if ($md5_datastore != $md5_activestore) {
$status |= $from_activestore ? CONFIGURATION_ACTIVESTORE_OVERRIDDEN : CONFIGURATION_DATASTORE_OVERRIDDEN;
}
else {
$status = CONFIGURATION_IN_SYNC;
configuration_set_hash($component, $identifier, $md5_activestore);
}
if ($md5_datastore == $config[$component][$identifier]['hash']) {
$status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
}
configuration_set_status($component, $identifier, $status);
$configuration[$component][$identifier]['datastore'] = is_array($items_code) && array_key_exists($identifier, $items_code) ? $items_code[$identifier] : '';
$configuration[$component][$identifier]['activestore'] = is_array($items) && array_key_exists($identifier, $items) ? $items[$identifier] : '';
cache_set("{$component}:{$identifier}", $configuration, 'cache_configuration');
}
foreach (file_scan_directory(drupal_get_path('module', 'configuration') . '/observers', '/.*/') as $filename) {
require $filename->uri;
}