From a6805f3f58caecdeb6e149a9da292937e21ea2e5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 22 Sep 2011 08:40:09 -0400 Subject: Fixes #3834 not loading version.php hundreds of times - thanks to srokap --- engine/lib/upgrade.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'engine/lib/upgrade.php') 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; } /** -- cgit v1.2.3