Function is now cached
authorRoland Häder <roland@mxchange.org>
Tue, 5 Jul 2011 04:31:07 +0000 (04:31 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 5 Jul 2011 04:31:07 +0000 (04:31 +0000)
inc/wrapper-functions.php

index 46d999cddcc5fdc6919afcdc486cc6efc5ddc6c5..db62ffb5d1a7353cc289fb8db39aed55c01af036 100644 (file)
@@ -432,7 +432,14 @@ function isDebugRegularExpressionEnabled () {
 
 // Checks wether the cache instance is valid
 function isCacheInstanceValid () {
-       return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
 }
 
 // Copies a file from source to destination and verifies if that goes fine.