Skip to content

Commit

Permalink
Hacky version stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Feb 22, 2015
1 parent 3aef5a2 commit 5c3099a
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions includes/drupal.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ function drush_drupal_version($drupal_root = NULL) {
$version = Drupal::VERSION;
}
}
else {
// D7 stores VERSION in bootstrap.inc.
// D6 and below does it in system.module.
$version_constant_paths = array('/includes/bootstrap.inc', '/modules/system/system.module');
foreach ($version_constant_paths as $path) {
if (file_exists($drupal_root . $path)) {
require_once $drupal_root . $path;
if (defined('VERSION')) {
$version = VERSION;
break;
}
}
}
// Try and find D7
// D7 stores VERSION in bootstrap.inc.
else if (file_exists($drupal_root . '/includes/bootstrap.inc')) {
require_once $drupal_root . '/includes/bootstrap.inc';
}
// Try and find D6
// D6 and below does it in system.module.
else if (file_exists($drupal_root . '/modules/system/system.module')) {
require_once $drupal_root . '/modules/system/system.module';
}
// Let other Drupal-like CMS's provide this info elsewhere
if (defined('VERSION')) {
$version = VERSION;
}
}
}
Expand Down Expand Up @@ -253,4 +253,3 @@ function _drush_drupal_parse_info_file($data, $merge_item = NULL) {
function drush_cid_install_profile() {
return drush_get_cid('install_profile', array(), array(drush_get_context('DRUSH_SELECTED_DRUPAL_SITE_CONF_PATH')));
}

1 comment on commit 5c3099a

@pirog
Copy link
Owner Author

@pirog pirog commented on 5c3099a Feb 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventually this needs to be abstracted out so the Boot class can define proper things for identifying versions and that sort of things.

Please sign in to comment.