]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Caching of expensive PHP functions:
[mailer.git] / inc / filters.php
index 9a3b441a7ab30fb8604ba51e1e411ebd6facda92..2a099fe8026f25f775003715dfd625cc9c175825 100644 (file)
@@ -548,7 +548,7 @@ function FILTER_RUN_RESET_INCLUDES () {
        // Is the config entry set?
        if (isExtensionInstalledAndNewer('sql_patches', '0.4.2')) {
                // Create current week mark
-               $currWeek = date('W', time());
+               $currWeek = getWeek();
 
                // Has it changed?
                if ((getConfig('last_week') != $currWeek) || ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'))) {
@@ -560,7 +560,7 @@ function FILTER_RUN_RESET_INCLUDES () {
                } // END - if
 
                // Create current month mark
-               $currMonth = date('m', time());
+               $currMonth = getMonth();
 
                // Has it changed?
                if ((getConfig('last_month') != $currMonth) || ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'))) {
@@ -708,7 +708,7 @@ function FILTER_RUN_DAILY_RESET () {
        if ((isInstallationPhase()) || (!isInstalled()) || (!isAdminRegistered()) || (!isExtensionInstalled('sql_patches'))) return;
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
-       if (((date('d', getConfig('last_update')) != date('d', time())) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getOutputMode() != 1)) {
+       if (((getDay(getConfig('last_update')) != getDay()) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getOutputMode() != 1)) {
                // Tell every module we are in reset-mode!
                doReset();
        } // END - if