function drush_enforce_requirement_drupal_dependencies

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

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

Parameters

$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/command.inc
Get a list of all implemented commands. This invokes hook_drush_command().

File

includes/command.inc, line 790
The drush command engine.

Code

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'])));
}