]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Applied naming convention
[mailer.git] / inc / filters.php
index fe1a36c00990c04e4831d5c539ca6c0d81e8110b..aece47961aae64b77d8563e3f4fe531bb8f7a88a 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -356,7 +354,7 @@ function FILTER_REMOVE_UPDATES ($data) {
                        // Shall we remove this update?
                        if (in_array($ext_name, getExtensionRemovalList())) {
                                // Then remove this extension!
-                               removeExtensionUpdateDependency($ext_name);
+                               removeExtensionDependency($ext_name);
                        } // END - if
                } // END - foreach
        } // END - if
@@ -523,7 +521,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                                $code = call_user_func($commandFunction, $data);
                        } else {
                                // Unsupported command detected
-                               debug_report_bug(__FUNCTION__, __LINE__, 'Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
+                               logDebugMessage(__FUNCTION__, __LINE__, 'Command cmd=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
                        }
                } // END - foreach
        } // END - if
@@ -712,15 +710,15 @@ function FILTER_TRIGGER_SENDING_POOL () {
 }
 
 // Filter for checking and updating SVN revision
-function FILTER_CHECK_SVN_REVISION () {
+function FILTER_CHECK_REPOSITORY_REVISION () {
        // Only execute this filter if installed and all config entries are there
        if ((!isInstalled()) || (!isConfigEntrySet('patch_level'))) return;
 
        // Check for patch level differences between databases and current hard-coded
-       if ((getCurrSvnRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURR_SVN_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) {
+       if ((getCurrentRepositoryRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURRENT_REPOSITORY_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) {
                // Update database and CONFIG array
-               updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrSvnRevision(), 'UNIX_TIMESTAMP()'));
-               setConfigEntry('patch_level', getCurrSvnRevision());
+               updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrentRepositoryRevision(), 'UNIX_TIMESTAMP()'));
+               setConfigEntry('patch_level', getCurrentRepositoryRevision());
                setConfigEntry('patch_ctime', time());
        } // END - if
 }
@@ -775,7 +773,7 @@ function FILTER_INIT_RANDOM_NUMBER () {
                // Generate random number
                setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getMemberId(), ''));
        } else {
-               // Generate weak (!!!) code
+               // Generate *WEAK* code
                setConfigEntry('RAND_NUMBER', mt_rand(1000000, 9999999));
        }
 
@@ -1016,5 +1014,15 @@ function FILTER_CLEANUP_DNS_CACHE () {
        } // END - if
 }
 
+// Filter for setting CURRENT_DATE, this is required after initialization of extensions
+function FILTER_SET_CURRENT_DATE () {
+       // Set current date
+       setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3'));
+
+       // Timestamp for yesterday, today ... all at 00:00 am
+       setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('ONE_DAY')));
+       setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
+}
+
 // [EOF]
 ?>