From f7b444654da175bb14dde1e0f4322f7a0829352f Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Tue, 5 Jul 2011 04:31:07 +0000
Subject: [PATCH] Function is now cached

---
 inc/wrapper-functions.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php
index 46d999cddc..db62ffb5d1 100644
--- a/inc/wrapper-functions.php
+++ b/inc/wrapper-functions.php
@@ -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.
-- 
2.39.5