diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-09-22 08:40:09 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-09-22 08:40:09 -0400 |
commit | a6805f3f58caecdeb6e149a9da292937e21ea2e5 (patch) | |
tree | d0a1de180377563097520225d7f7062f06f7497f /engine/lib/upgrade.php | |
parent | 49d433e8b0404c91be3853b11c275c5928af23b9 (diff) | |
download | elgg-a6805f3f58caecdeb6e149a9da292937e21ea2e5.tar.gz elgg-a6805f3f58caecdeb6e149a9da292937e21ea2e5.tar.bz2 |
Fixes #3834 not loading version.php hundreds of times - thanks to srokap
Diffstat (limited to 'engine/lib/upgrade.php')
-rw-r--r-- | engine/lib/upgrade.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/engine/lib/upgrade.php b/engine/lib/upgrade.php index dc3911062..dc1213187 100644 --- a/engine/lib/upgrade.php +++ b/engine/lib/upgrade.php @@ -160,7 +160,7 @@ function elgg_get_upgrade_files($upgrade_path = null) { } /** - * Get the current version information + * Get the current Elgg version information * * @param bool $humanreadable Whether to return a human readable version (default: false) * @@ -169,13 +169,18 @@ function elgg_get_upgrade_files($upgrade_path = null) { function get_version($humanreadable = false) { global $CONFIG; + static $version, $release; + if (isset($CONFIG->path)) { - if (include($CONFIG->path . "version.php")) { - return (!$humanreadable) ? $version : $release; + if (!isset($version) || !isset($release)) { + if (!include($CONFIG->path . "version.php")) { + return false; + } } + return (!$humanreadable) ? $version : $release; } - return FALSE; + return false; } /** |