X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=50a4a650459c432c5bc6886650726fc2733613b1;hp=0fd3e13cd667518466772aaa876364bfebc6b440;hb=f2b603aed42bfdf7a94611d7bae71fe3a1048890;hpb=155492a5b96cec674846973a8524238b0365a848 diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 0fd3e13cd6..50a4a65045 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -221,19 +221,19 @@ ORDER BY } // "Registers" a new filter function -function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TRUE, $force = FALSE, $isDryRun = FALSE) { +function registerFilter ($file, $line, $filterName, $filterFunction, $silentAbort = TRUE, $force = FALSE, $isDryRun = FALSE) { // Extend the filter function name $filterFunction = 'FILTER_' . strtoupper($filterFunction); // Debug message with FILTER_ prefix - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ',F=' . basename($F) . ',L=' . $L . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ',file=' . basename($file) . ',line=' . $line . ' - ENTERED!'); // 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())) { // Add fatal message - reportBug(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered! F=%s,L=%s,force=%d", $filterName, $filterFunction, basename($F), $L, intval($force))); + 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 // Abort here @@ -245,25 +245,25 @@ function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TR // Is the function there? if (!function_exists($filterFunction)) { // Then abort here - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s. F=%s,L=%s,force=%d", $filterFunction, $filterName, basename($F), $L, intval($force))); + logDebugMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s. file=%s,L=%s,force=%d", $filterFunction, $filterName, basename($file), $line, intval($force))); return FALSE; } // END - if // Simply add it to the array - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REGISTER: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',F=' . basename($F) . ',L=' . $L); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REGISTER: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',file=' . basename($file) . ',line=' . $line); $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'A'; $GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = '0'; } // END - if - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ',F=' . basename($F) . ',L=' . $L . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ',file=' . basename($file) . ',line=' . $line . ' - EXIT!'); // Worked return TRUE; } // "Unregisters" a filter from the given chain -function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = FALSE, $isDryRun = FALSE) { - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ' - ENTERED!'); +function unregisterFilter ($file, $line, $filterName, $filterFunction, $force = FALSE, $isDryRun = FALSE) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . $file . ',line=' . $line . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ' - ENTERED!'); // Extend the filter function name only if not loaded from database if (!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) { @@ -280,11 +280,11 @@ function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = FALSE, // Shall we remove? (default, not while just showing an extension removal) if (($isDryRun === FALSE) && (isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction]))) { // Mark for filter removal - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - REMOVE!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . $file . ',line=' . $line . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - REMOVE!'); $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R'; } // END - if - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . $file . ',line=' . $line . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ' - EXIT!'); // Worked return TRUE;