function drush_drupal_major_version

8.0.x drupal.inc drush_drupal_major_version($drupal_root = NULL)
6.x drupal.inc drush_drupal_major_version($drupal_root = NULL)
7.x drupal.inc drush_drupal_major_version($drupal_root = NULL)
3.x drush.inc drush_drupal_major_version()
4.x drush.inc drush_drupal_major_version($drupal_root = NULL)
5.x drupal.inc drush_drupal_major_version($drupal_root = NULL)
master drupal.inc drush_drupal_major_version($drupal_root = NULL)

Returns the Drupal major version number (6, 7, 8 ...)

58 calls to drush_drupal_major_version()
annotationcommand_adapter_discover in includes/annotationcommand_adapter.inc
Search for annotation commands at the provided search path.
annotationcommand_adapter_refine_searchpaths in includes/annotationcommand_adapter.inc
In some circumstances, Drush just does a deep search for any *.drush.inc file, so that it can find all commands, in enabled and disabled modules alike, for the purpose of displaying the help text for that command.
Commandfiles::add in lib/Drush/Command/Commandfiles.php
core_drush_help_alter in commands/core/core.drush.inc
Implements hook_drush_help_alter().
core_watchdog_format_result in commands/core/watchdog.drush.inc
Format a watchdog database row.

... See full list

1 string reference to 'drush_drupal_major_version'
Commandfiles::add in lib/Drush/Command/Commandfiles.php

File

includes/drupal.inc, line 62
Utility functions related to Drupal.

Code

function drush_drupal_major_version($drupal_root = NULL) {
  $major_version = FALSE;
  if ($version = drush_drupal_version($drupal_root)) {
    $version_parts = explode('.', $version);
    if (is_numeric($version_parts[0])) {
      $major_version = (integer) $version_parts[0];
    }
  }
  return $major_version;
}