Skip to content

Instantly share code, notes, and snippets.

@gibbs
Created April 10, 2013 12:55
Show Gist options
  • Save gibbs/5354355 to your computer and use it in GitHub Desktop.
Save gibbs/5354355 to your computer and use it in GitHub Desktop.
Get the installed version of Drupal
<?php
/**
* Get Drupal 7 current version
*/
$version = NULL;
$version_file = 'includes/bootstrap.inc';
// Path to installation
$install_path = '/home/user/website.com/public_html';
$file = realpath($install_path . '/' . $version_file);
include_once $file;
$version = defined('VERSION') ? VERSION : FALSE;
echo $version;
//return VERSION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment