function drush_check_module_dependencies

8.0.x environment_7.inc drush_check_module_dependencies($modules, $module_info)
8.0.x environment_6.inc drush_check_module_dependencies($modules, $module_info)
8.0.x environment.inc drush_check_module_dependencies($modules, $module_info)
6.x environment_6.inc drush_check_module_dependencies($modules, $module_info)
6.x environment.inc drush_check_module_dependencies($modules, $module_info)
6.x environment_7.inc drush_check_module_dependencies($modules, $module_info)
7.x environment_7.inc drush_check_module_dependencies($modules, $module_info)
7.x environment_6.inc drush_check_module_dependencies($modules, $module_info)
7.x environment.inc drush_check_module_dependencies($modules, $module_info)
3.x environment_7.inc drush_check_module_dependencies($modules, $module_info)
3.x environment_6.inc drush_check_module_dependencies($modules, $module_info)
3.x environment_5.inc drush_check_module_dependencies($modules, $module_info)
4.x environment_6.inc drush_check_module_dependencies($modules, $module_info)
4.x environment_5.inc drush_check_module_dependencies($modules, $module_info)
4.x environment.inc drush_check_module_dependencies($modules, $module_info)
5.x environment_6.inc drush_check_module_dependencies($modules, $module_info)
5.x environment.inc drush_check_module_dependencies($modules, $module_info)
master environment_7.inc drush_check_module_dependencies($modules, $module_info)
master environment.inc drush_check_module_dependencies($modules, $module_info)

Return dependencies and its status for modules.

Parameters

$modules: Array of module names

$module_info: Drupal 'files' array for modules as returned by drush_get_modules().

Return value

Array with dependencies and status for $modules

1 call to drush_check_module_dependencies()
drush_pm_enable in commands/pm/pm.drush.inc
Command callback. Enable one or more projects.

File

commands/core/drupal/environment_6.inc, line 40
Specific functions for a drupal 5 environment. drush_include_engine() magically includes either this file or environment_X.inc depending on which version of drupal drush is called from.

Code

function drush_check_module_dependencies($modules, $module_info) {
  $status = array();
  foreach ($modules as $key => $module) {
    $dependencies = $module_info[$module]->info['dependencies'];
    $unmet_dependencies = array_diff($dependencies, array_keys($module_info));
    if (!empty($unmet_dependencies)) {
      $status[$key]['error'] = array(
        'code' => 'DRUSH_PM_ENABLE_DEPENDENCY_NOT_FOUND',
        'message' => dt('Module !module cannot be enabled because it depends on the following modules which could not be found: !unmet_dependencies', array('!module' => $module, '!unmet_dependencies' => implode(',', $unmet_dependencies))),
      );
    }
    else {
      $status[$key]['dependencies'] = $dependencies;
    }
  }

  return $status;
}