You are here

function configuration_get_normal in Configuration Management 7

Get normal objects for a given module/component pair.

1 call to configuration_get_normal()
configuration_get_signature in ./configuration.export.inc
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.

File

./configuration.export.inc, line 488

Code

function configuration_get_normal($component, $module_name, $reset = FALSE) {
  static $cache;
  if (!isset($cache) || $reset) {
    $cache = array();
  }
  if (!isset($cache[$module_name][$component])) {
    configuration_include();
    $code = NULL;
    $module = configuration_get_configuration($module_name);

    // Special handling for dependencies component.
    if ($component === 'dependencies') {
      $cache[$module_name][$component] = isset($module->info['dependencies']) ? array_filter($module->info['dependencies'], 'module_exists') : array();
    }
    else {
      $default_hook = configuration_get_default_hooks($component);
      if ($module && $default_hook && isset($module->info['configuration'][$component]) && configuration_hook($component, 'configuration_export_render')) {
        $code = configuration_invoke($component, 'configuration_export_render', $module_name, $module->info['configuration'][$component], NULL);
        $cache[$module_name][$component] = isset($code[$default_hook]) ? eval($code[$default_hook]) : FALSE;
      }
    }

    // Clear out vars for memory's sake.
    unset($code);
    unset($module);
  }
  return isset($cache[$module_name][$component]) ? $cache[$module_name][$component] : FALSE;
}