From: Roland Häder Date: Sat, 20 Oct 2012 22:21:49 +0000 (+0000) Subject: These lines can be really noisy, so comment them out, but they shall only work in... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=62a87e52c1caba26553195a1bffcfbd5714d4d7b;p=mailer.git These lines can be really noisy, so comment them out, but they shall only work in debug-mode --- diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 8c1ec94b52..e5fe404f48 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -2030,15 +2030,36 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = // Send data through the filter function if found if ((isset($filterFunctions[$key])) && (isset($extraValues[$key . '_list']))) { - // Filter function set! - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!'); + // Debug mode enabled? + if (isDebugModeEnabled()) { + // Then log it + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!'); + } // END - if + + // Filter function set, so run it $sqlValues[$key] = call_user_func_array($filterFunctions[$key], merge_array(array($columnName), $extraValues[$key . '_list'])); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!'); + + // Debug mode enabled? + if (isDebugModeEnabled()) { + // Then log it + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!'); + } // END - if } elseif ((isset($filterFunctions[$key])) && (!empty($filterFunctions[$key])) && (!empty($sqlValues[$key]))) { + // Debug mode enabled? + if (isDebugModeEnabled()) { + // Then log it + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!'); + } // END - if + // Run through an extra filter - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!'); $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], NULL); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!'); + + // Debug mode enabled? + if (isDebugModeEnabled()) { + // Then log it + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!'); + } // END - if + } // Is the value not a number? @@ -2131,11 +2152,22 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun // Filter function + extra value set $entries[$id] = handleExtraValues($filterFunctions[$key], $entries[$id], $extraValues[$key]); } elseif (isset($filterFunctions[$search])) { - // Filter function set - //* BUG: */ die($id.'/'.$key.'='.$entries[$id].'/'.$filterFunctions[$search]); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - BEFORE!'); + // Debug mode enabled? + if (isDebugModeEnabled()) { + // Then log it + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - BEFORE!'); + } // END - if + + // Handle extra values $entries[$id] = handleExtraValues($filterFunctions[$search], $entries[$id], NULL); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - AFTER!'); + + // Debug mode enabled? + if (isDebugModeEnabled()) { + // Then log it + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - AFTER!'); + } // END - if + + // Make sure entries[id] is not bool, then something went wrong assert(!is_bool($entries[$id])); }