function drush_enforce_requirement_core

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

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


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


includes/, line 813
The drush command engine.


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));