X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=066ca223657ee8ccb5c9d0571ccdbb49e5c8fe6a;hp=f944978b242a1955e18164cc9c3bad4976347093;hb=b6c301dece2d7a3375321d4f3c0498ceaeb5a2a6;hpb=c8d76610eb94093d4eed4fcd8a6cb72e74c8f6d8 diff --git a/inc/filter-functions.php b/inc/filter-functions.php index f944978b24..066ca22365 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -104,7 +104,8 @@ ORDER BY registerFilter('init', 'INIT_EXTENSIONS'); registerFilter('init', 'SET_CURRENT_DATE'); registerFilter('init', 'INIT_RANDOM_NUMBER'); - registerFilter('init', 'CHECK_SVN_REVISION'); + registerFilter('init', 'CHECK_REPOSITORY_REVISION'); + registerFilter('init', 'RUN_HOURLY_RESET'); registerFilter('init', 'RUN_DAILY_RESET'); registerFilter('init', 'TRIGGER_SENDING_POOL'); registerFilter('init', 'DETERMINE_USERNAME'); @@ -158,6 +159,9 @@ ORDER BY // Generic extension update filters registerFilter('extension_update', 'UPDATE_EXTENSION_DATA'); + // Do hourly reset stuff, keep this entry first in this chain: + registerFilter('hourly', 'RUN_HOURLY_INCLUDES'); + // Do reset stuff, keep this entry first in this chain: registerFilter('reset', 'RUN_RESET_INCLUDES'); @@ -254,7 +258,7 @@ function runFilterChain ($filterName, $data = null) { // Log not found filters in debug-mode if (isDebugModeEnabled()) { // Log it away... - logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' not found!'); + logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' not found.'); } // END - if // Abort here and return content @@ -339,5 +343,30 @@ function prepareFilterArray () { $GLOBALS['cache_array']['filter'] = $filterArray; } +// Loads filter for given extension if present. This function will silently +// ignore absent filter files. +function loadExtensionFilters ($ext_name) { + // Do we have cache entry? + if (!isset($GLOBALS[__FUNCTION__][$ext_name])) { + // Default is not found + $GLOBALS[__FUNCTION__][$ext_name] = false; + + // Construct include file name + $incFileName = sprintf("inc/filter/%s_filter.php", $ext_name); + + // Is the include file readable? + if (isIncludeReadable($incFileName)) { + // Load the include file + loadIncludeOnce($incFileName); + + // Mark the file as loaded + $GLOBALS[__FUNCTION__][$ext_name] = true; + } elseif (isDebugModeEnabled()) { + // Log missing file + logDebugMessage(__FUNCTION__, __LINE__, 'Include file ' . $incFileName . ' for extension ' . $ext_name . ' is missing.'); + } + } // END - if +} + // [EOF] ?>