// Mark it as initialized
$GLOBALS['filter_init'] = TRUE;
- } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
+ } elseif ((!isInstaller()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
// Init add
$add = '';
if (isExtensionINstalledAndNewer('sql_patches', '0.6.0')) {
registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_DAILY_RESET');
registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_WEEKLY_RESET');
registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_MONTHLY_RESET');
+ registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_YEARLY_RESET');
registerFilter(__FUNCTION__, __LINE__, 'init', 'TRIGGER_SENDING_POOL');
// @TODO Remove this forced removal after a year or so
unregisterFilter(__FUNCTION__, __LINE__, 'init', 'DETERMINE_USERNAME', TRUE);
// Do monthly stuff, keep this entry first in this chain:
registerFilter(__FUNCTION__, __LINE__, 'monthly', 'RUN_MONTHLY_INCLUDES');
+ // Do yearly stuff, keep this entry first in this chain:
+ registerFilter(__FUNCTION__, __LINE__, 'yearly', 'RUN_YEARLY_INCLUDES');
+
// Remove extension
registerFilter(__FUNCTION__, __LINE__, 'extension_remove', 'REMOVE_EXTENSION');
// Is that filter already there?
if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === FALSE)) {
// In installation phase we always want to abort
- if (($silentAbort === FALSE) || (isInstallationPhase())) {
+ if (($silentAbort === FALSE) || (isInstaller())) {
// Add fatal message
reportBug(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered! file=%s,L=%s,force=%d", $filterName, $filterFunction, basename($file), $line, intval($force)));
} // END - if
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',count()=' . count($GLOBALS['cache_array']['filter']['chains'][$filterName]));
$returnValue = $filterData;
+ // Remove any existing flag(s)
+ unset($GLOBALS['filter_chain_aborted']);
+
// Then run all filters
foreach ($GLOBALS['cache_array']['filter']['chains'][$filterName] as $filterFunction => $active) {
// Debug message
// Is this filter there?
if (!function_exists($filterFunction)) {
// Should be fixed
- reportBug(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - AUTO-UNREGISTERED!');
+ reportBug(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',active=' . $active . ' - AUTO-UNREGISTERED!');
} // END - if
// Call the filter chain
// Debug message
logDebugMessage(__FUNCTION__, __LINE__, 'Skipped: name=' . $filterName . ',func=' . $filterFunction . ',active=' . $active);
}
+
+ // Abort loop?
+ if (isFilterChainAborted()) {
+ // Yes, then abort here
+ break;
+ } // END - if
} // END - foreach
// Return the filtered content
$GLOBALS[__FUNCTION__][$ext_name] = FALSE;
// Construct include file name
- $incFileName = sprintf("inc/filter/%s_filter.php", $ext_name);
+ $incFileName = sprintf('inc/filter/%s_filter.php', $ext_name);
// Is the include file readable?
if (isIncludeReadable($incFileName)) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',result=' . intval($GLOBALS[__FUNCTION__][$ext_name]) . ' - EXIT!');
}
+// Checks whether the filter chain has been aborted
+function isFilterChainAborted () {
+ // Determine it
+ return ((isset($GLOBALS['filter_chain_aborted'])) && ($GLOBALS['filter_chain_aborted'] === TRUE));
+}
+
// [EOF]
?>