You are here

function configuration_get_signature in Configuration Management 7

Wrapper around configuration_get_[storage] to return an md5hash of a normalized defaults/normal object array. Can be used to compare normal/default states of a module's component.

2 calls to configuration_get_signature()
configuration_get_component_states in ./configuration.export.inc
Retrieve an array of configuration/components and their current states.
configuration_set_signature in ./configuration.export.inc
Set the signature of a module/component pair in the codecache.

File

./configuration.export.inc, line 429

Code

function configuration_get_signature($state = 'default', $module_name, $component, $reset = FALSE) {
  switch ($state) {
    case 'cache':
      $codecache = variable_get('configuration_codecache', array());
      return isset($codecache[$module_name][$component]) ? $codecache[$module_name][$component] : FALSE;
    case 'default':
      $objects = configuration_get_default($component, $module_name, TRUE, $reset);
      break;
    case 'normal':
      $objects = configuration_get_normal($component, $module_name, $reset);
      break;
  }
  if (!empty($objects)) {
    $objects = (array) $objects;
    _configuration_sanitize($objects);
    return md5(_configuration_linetrim(configuration_var_export($objects)));
  }
  return FALSE;
}