X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=2127a208e7e62d1e6b70ade8346aa97d1f12fdd9;hp=218bab23d89a1898550aac7930a50e4b42f1bdcd;hb=e45e218c4f629ec63f0788cab231bfc88b3fa46e;hpb=aa533f1d78c45f15f7749ee7c2819700e6722f1b
diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php
index 218bab23d8..2127a208e7 100644
--- a/inc/wrapper-functions.php
+++ b/inc/wrapper-functions.php
@@ -368,8 +368,14 @@ function isSqlDebuggingEnabled () {
// Checks wether we shall debug regular expressions
function isDebugRegularExpressionEnabled () {
- // Simply check it
- return ((isConfigEntrySet('DEBUG_REGEX')) && (getConfig('DEBUG_REGEX') == 'Y'));
+ // Is cache set?
+ if (!isset($GLOBALS['is_regular_exp_debug_enabled'])) {
+ // Simply check it
+ $GLOBALS['is_regular_exp_debug_enabled'] = ((isConfigEntrySet('DEBUG_REGEX')) && (getConfig('DEBUG_REGEX') == 'Y'));
+ } // END - if
+
+ // Return it
+ return $GLOBALS['is_regular_exp_debug_enabled'];
}
// Checks wether the cache instance is valid
@@ -707,16 +713,26 @@ function redirectToDereferedUrl ($URL) {
// Wrapper function for checking if extension is installed and newer or same version
function isExtensionInstalledAndNewer ($ext_name, $version) {
+ // Is an cache entry found?
+ if (!isset($GLOBALS['ext_installed_newer'][$ext_name][$version])) {
+ $GLOBALS['ext_installed_newer'][$ext_name][$version] = ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
+ } // END - if
+
// Return it
- //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=>'.$version.'
';
- return ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
+ //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=>'.$version.':'.intval($GLOBALS['ext_installed_newer'][$ext_name][$version]).'
';
+ return $GLOBALS['ext_installed_newer'][$ext_name][$version];
}
// Wrapper function for checking if extension is installed and older than given version
function isExtensionInstalledAndOlder ($ext_name, $version) {
+ // Is an cache entry found?
+ if (!isset($GLOBALS['ext_installed_older'][$ext_name][$version])) {
+ $GLOBALS['ext_installed_older'][$ext_name][$version] = ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
+ } // END - if
+
// Return it
- //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'<'.$version.'
';
- return ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
+ //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'<'.$version.':'.intval($GLOBALS['ext_installed_older'][$ext_name][$version]).'
';
+ return $GLOBALS['ext_installed_older'][$ext_name][$version];
}
// Set username
@@ -750,7 +766,14 @@ function isInstallationPhase () {
// Checks wether the extension demo is actuve and the admin login is demo (password needs to be demo, too!)
function isDemoModeActive () {
- return ((isExtensionActive('demo')) && (getSession('admin_login') == 'demo'));
+ // Is cache set?
+ if (!isset($GLOBALS['demo_mode_active'])) {
+ // Simply check it
+ $GLOBALS['demo_mode_active'] = ((isExtensionActive('demo')) && (getSession('admin_login') == 'demo'));
+ } // END - if
+
+ // Return it
+ return $GLOBALS['demo_mode_active'];
}
// Getter for PHP caching value