]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter-functions.php
More fixes for new installer and script in general :(
[mailer.git] / inc / filter-functions.php
index c75f48417eda2ff8170a372b6b188a324921d019..0f50b2e02724a88a0384d63b7fe830836233b6fc 100644 (file)
@@ -217,7 +217,7 @@ function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TR
        $filterFunction = 'FILTER_' . strtoupper($filterFunction);
 
        // Debug message with FILTER_ prefix
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',F=' . basename($F) . ',L=' . $L . ' - ENTERED!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ',F=' . basename($F) . ',L=' . $L . ' - ENTERED!');
 
        // Is that filter already there?
        if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === FALSE)) {
@@ -236,7 +236,7 @@ function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TR
                // Is the function there?
                if (!function_exists($filterFunction)) {
                        // Then abort here
-                       addFatalMessage(__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. F=%s,L=%s,force=%d", $filterFunction, $filterName, basename($F), $L, intval($force)));
                        return FALSE;
                } // END - if
 
@@ -246,7 +246,10 @@ function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TR
                $GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = '0';
        } // END - if
 
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',F=' . basename($F) . ',L=' . $L . ' - EXIT!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ',F=' . basename($F) . ',L=' . $L . ' - EXIT!');
+
+       // Worked
+       return TRUE;
 }
 
 // "Unregisters" a filter from the given chain
@@ -261,7 +264,7 @@ function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = FALSE,
        // Is that filter there?
        if ((!isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === FALSE)) {
                // Not found, so abort here
-               addFatalMessage(__FUNCTION__, __LINE__, sprintf(getMessage('FILTER_FAILED_NOT_REMOVED'), $filterFunction, $filterName));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Filter function %s cannot be unregistered from filter %s.', $filterFunction, $filterName));
                return FALSE;
        } // END - if
 
@@ -273,6 +276,9 @@ function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = FALSE,
        } // END - if
 
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ' - EXIT!');
+
+       // Worked
+       return TRUE;
 }
 
 // "Runs" the given filters, filterData is optional and can be any type of data
@@ -309,7 +315,7 @@ function runFilterChain ($filterName, $filterData = NULL) {
                        } // END - if
 
                        // Call the filter chain
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterName . '/' . $filterFunction . ',[]=' . gettype($returnValue));
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterName . '/' . $filterFunction . ',[]=' . gettype($returnValue) . ' - CALLING!');
                        $returnValue = call_user_func_array($filterFunction, array($returnValue));
 
                        // Update usage counter