You are here

function dependencies_configuration_rebuild in Configuration Management 7

Implements hook_configuration_rebuild(). Ensure that all of a feature's dependencies are enabled.

1 call to dependencies_configuration_rebuild()
dependencies_configuration_revert in includes/configuration.features.inc
Implements hook_configuration_revert().

File

includes/configuration.features.inc, line 57

Code

function dependencies_configuration_rebuild($module) {
  $feature = configuration_get_configuration($module);
  if (!empty($feature->info['dependencies'])) {
    $install = array();
    foreach ($feature->info['dependencies'] as $dependency) {

      // Parse the dependency string into the module name and version information.
      $parsed_dependency = drupal_parse_dependency($dependency);
      $dependency = $parsed_dependency['name'];
      if (!module_exists($dependency)) {
        $install[] = $dependency;
      }
    }
    if (!empty($install)) {
      configuration_install_modules($install);
    }
  }
}