function drush_enforce_requirement_drupal_dependencies

6.x drush_enforce_requirement_drupal_dependencies(&$command)
3.x drush_enforce_requirement_drupal_dependencies(&$command)
4.x drush_enforce_requirement_drupal_dependencies(&$command)
5.x drush_enforce_requirement_drupal_dependencies(&$command)

Check that a command has its declared dependencies available or have no dependencies.


$command: Command to check. Any errors will be added to the 'bootstrap_errors' element.

Return value

TRUE if command is valid.

1 call to drush_enforce_requirement_drupal_dependencies()
drush_get_commands in includes/
Get a list of all implemented commands. This invokes hook_drush_command().


includes/, line 790
The drush command engine.


function drush_enforce_requirement_drupal_dependencies(&$command) {
  if (empty($command['drupal dependencies'])) {
    return TRUE;
  else {
    foreach ($command['drupal dependencies'] as $dependency) {
      if (function_exists('module_exists') && module_exists($dependency)) {
        return TRUE;
  $command['bootstrap_errors']['DRUSH_COMMAND_DEPENDENCY_ERROR'] = dt('Command !command needs the following modules installed/enabled to run: !dependencies.', array('!command' => $command['command'], '!dependencies' => implode(', ', $command['drupal dependencies'])));