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

52 calls to drush_drupal_major_version()
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.
DrupalBoot::bootstrap_drupal_root in lib/Drush/Boot/DrupalBoot.php
Bootstrap Drush with a valid Drupal Directory.
DrupalBoot::bootstrap_drupal_root_validate in lib/Drush/Boot/DrupalBoot.php
Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.

... 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;
}