function DrupalBoot8::get_version

8.0.x DrupalBoot8.php DrupalBoot8::get_version($drupal_root)
master DrupalBoot8.php DrupalBoot8::get_version($drupal_root)

Given a site root directory, determine the exact version of the software.

Parameters

string $root: The full path to the site installation, with no trailing slash.

Return value

string|NULL The version string for the current version of the software, e.g. 8.1.3

Overrides DrupalBoot::get_version

File

lib/Drush/Boot/DrupalBoot8.php, line 34

Namespace

Drush\Boot

Class

DrupalBoot8

Code

function get_version($drupal_root) {
  // Load the autoloader so we can access the class constants.
  drush_drupal_load_autoloader($drupal_root);
  // Drush depends on bootstrap being loaded at this point.
  require_once $drupal_root . '/core/includes/bootstrap.inc';
  if (defined('Drupal::VERSION')) {
    return \Drupal::VERSION;
  }
}