You are here

function _features_export_maximize_dependencies in Features 7

Same name and namespace in other branches
  1. 6 features.export.inc \_features_export_maximize_dependencies()
  2. 7.2 features.export.inc \_features_export_maximize_dependencies()

Iterates over a list of dependencies and maximize the list of modules.

3 calls to _features_export_maximize_dependencies()
features_admin_form in ./features.admin.inc
Form constructor for the features configuration form.
features_get_orphans in ./features.module
Generate an array of feature dependencies that have been orphaned.
features_install_modules in ./features.module
Enables and installs an array of modules, ignoring those already enabled & installed. Consider this a helper or extension to drupal_install_modules().

File

./features.export.inc, line 146

Code

function _features_export_maximize_dependencies($dependencies, $module_name = '', $maximized = array(), $first = TRUE) {
  foreach ($dependencies as $k => $v) {
    $parsed_dependency = drupal_parse_dependency($v);
    $name = $parsed_dependency['name'];
    if (!in_array($name, $maximized)) {
      $maximized[] = $name;
      $module = features_get_modules($name);
      if ($module && !empty($module->info['dependencies'])) {
        $maximized = array_merge($maximized, _features_export_maximize_dependencies($module->info['dependencies'], $module_name, $maximized, FALSE));
      }
    }
  }
  return array_unique($maximized);
}