]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter-functions.php
Code style changed, ext-user continued:
[mailer.git] / inc / filter-functions.php
index 2048ba28aedfd5b50da504d9026020a246234a3e..39f980c2674c5a6fa9e577a7ff02e9b07ef8fea6 100644 (file)
@@ -54,7 +54,7 @@ function initFilterSystem () {
                prepareFilterArray();
 
                // Mark it as initialized
-               $GLOBALS['filter_init'] = true;
+               $GLOBALS['filter_init'] = TRUE;
        } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
                // Init add
                $add = '';
@@ -85,7 +85,7 @@ ORDER BY
                                $GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = '0';
 
                                // Mark this filter as loaded (from database)
-                               $GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction] = true;
+                               $GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction] = TRUE;
 
                                // Set this filter
                                $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = $filterArray['filter_active'];
@@ -201,7 +201,7 @@ ORDER BY
 }
 
 // "Registers" a new filter function
-function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = true, $force = false, $isDryRun = false) {
+function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TRUE, $force = FALSE, $isDryRun = FALSE) {
        // Extend the filter function name
        $filterFunction = 'FILTER_' . strtoupper($filterFunction);
 
@@ -209,24 +209,24 @@ function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = tr
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',F=' . basename($F) . ',L=' . $L . ' - ENTERED!');
 
        // Is that filter already there?
-       if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === false)) {
+       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) || (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)));
                } // END - if
 
                // Abort here
-               return false;
+               return FALSE;
        } // END - if
 
        // Shall we add it?
-       if ($isDryRun === false) {
+       if ($isDryRun === FALSE) {
                // 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)));
-                       return false;
+                       return FALSE;
                } // END - if
 
                // Simply add it to the array
@@ -239,7 +239,7 @@ function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = tr
 }
 
 // "Unregisters" a filter from the given chain
-function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false, $isDryRun = false) {
+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!');
 
        // Extend the filter function name only if not loaded from database
@@ -248,14 +248,14 @@ function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false,
        } // END - if
 
        // Is that filter there?
-       if ((!isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === false)) {
+       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));
-               return false;
+               return FALSE;
        } // END - if
 
        // Shall we remove? (default, not while just showing an extension removal)
-       if ($isDryRun === false) {
+       if ($isDryRun === FALSE) {
                // Mark for filter removal
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - REMOVE!');
                $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
@@ -331,7 +331,7 @@ function prepareFilterArray () {
        // Abort here if array is absend (e.g. not cached)
        if (!isset($GLOBALS['cache_array']['filter']['filter_name'])) {
                // Abort silently
-               return false;
+               return FALSE;
        } // END - if
 
        // Init dummy array
@@ -348,7 +348,7 @@ function prepareFilterArray () {
 
                // Add the element with mapped index
                $filterArray['counter'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_counter'][$idx];
-               $filterArray['loaded'][$filterName][$filterFunction]  = true;
+               $filterArray['loaded'][$filterName][$filterFunction]  = TRUE;
                $filterArray['chains'][$filterName][$filterFunction]  = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
        } // END - foreach
 
@@ -370,7 +370,7 @@ function loadExtensionFilters ($ext_name) {
        // Is there a cache entry?
        if (!isset($GLOBALS[__FUNCTION__][$ext_name])) {
                // Default is not found
-               $GLOBALS[__FUNCTION__][$ext_name] = false;
+               $GLOBALS[__FUNCTION__][$ext_name] = FALSE;
 
                // Construct include file name
                $incFileName = sprintf("inc/filter/%s_filter.php", $ext_name);
@@ -381,7 +381,7 @@ function loadExtensionFilters ($ext_name) {
                        loadIncludeOnce($incFileName);
 
                        // Mark the file as loaded
-                       $GLOBALS[__FUNCTION__][$ext_name] = true;
+                       $GLOBALS[__FUNCTION__][$ext_name] = TRUE;
                } elseif (isDebugModeEnabled()) {
                        // Log missing file
                        //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Filter include file ' . $incFileName . ' for extension ' . $ext_name . ' is missing.');