function drush_enforce_requirement_core

8.0.x command.inc drush_enforce_requirement_core(&$command)
6.x command.inc drush_enforce_requirement_core(&$command)
7.x command.inc drush_enforce_requirement_core(&$command)
3.x command.inc drush_enforce_requirement_core(&$command)
4.x command.inc drush_enforce_requirement_core(&$command)
5.x command.inc drush_enforce_requirement_core(&$command)
master command.inc drush_enforce_requirement_core(&$command)

Check that a command is valid for the current major version of core.

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

File

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

Code

function drush_enforce_requirement_core(&$command) {
  $core = $command['core'];
  if (empty($core) || in_array(drush_drupal_major_version(), $core)) {
    return TRUE;
  }
  $versions = array_pop($core);
  if (!empty($core)) {
    $versions = implode(', ', $core) . dt(' or ') . $versions;
  }
  $command['bootstrap_errors']['DRUSH_COMMAND_CORE_VERSION_ERROR'] = dt('Command !command requires Drupal core version !versions to run.', array('!command' => $command['command'], '!versions' => $versions));
}