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 (5, 6, 7 ...)

36 calls to drush_drupal_major_version()
core_watchdog_format_result in commands/core/watchdog.drush.inc
Format a watchdog database row.
core_watchdog_message_types in commands/core/watchdog.drush.inc
Helper function to obtain the message types based on drupal version.
drush_backend_batch_process in includes/batch.inc
Process a Drupal batch by spawning multiple Drush processes.
drush_batch_command in includes/batch.inc
Process sets from the specified batch.
drush_core_cache_clear in commands/core/clear.cache.inc
Command callback for drush cache-clear.

... See full list

File

includes/drush.inc, line 235
The drush API implementation and helpers.

Code

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