Yet another wrapper function 'cached'
[mailer.git] / inc / wrapper-functions.php
index c81d9d09d30ff956b334d6c60580579376e254d3..e7ef273e797b4a0562efcbe0501e61b9973c5509 100644 (file)
@@ -356,11 +356,18 @@ function isDebugModeEnabled () {
 
 // Checks wether SQL debugging is enabled
 function isSqlDebuggingEnabled () {
-       return ((isConfigEntrySet('DEBUG_SQL')) && (getConfig('DEBUG_SQL') == 'Y'));
+       // Is cache set?
+       if (!isset($GLOBALS['is_sql_debug_enabled'])) {
+               // Determine if SQL debugging is enabled
+               $GLOBALS['is_sql_debug_enabled'] = ((isConfigEntrySet('DEBUG_SQL')) && (getConfig('DEBUG_SQL') == 'Y'));
+       } // END - if
+
+       // Return it
+       return $GLOBALS['is_sql_debug_enabled'];
 }
 
 // Checks wether we shall debug regular expressions
-function isDebugRegExpressionEnabled () {
+function isDebugRegularExpressionEnabled () {
        // Simply check it
        return ((isConfigEntrySet('DEBUG_REGEX')) && (getConfig('DEBUG_REGEX') == 'Y'));
 }