]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3834 not loading version.php hundreds of times - thanks to srokap
authorCash Costello <cash.costello@gmail.com>
Thu, 22 Sep 2011 12:40:09 +0000 (08:40 -0400)
committerCash Costello <cash.costello@gmail.com>
Thu, 22 Sep 2011 12:40:09 +0000 (08:40 -0400)
engine/lib/upgrade.php

index dc3911062bfb8b980b754779e51159c6550d740e..dc1213187e0cc245d965f0c948ff1cbb634826e7 100644 (file)
@@ -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;
 }
 
 /**