} // END - if
// Shall we update usage counters (ONLY FOR DEBUGGING!)
- if ((isExtensionInstalledAndNewer('sql_patches', '0.6.0')) && (isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') == 'Y')) {
+ if (isFilterUsageUpdateEnabled()) {
// Update all counters
foreach ($GLOBALS['cache_array']['filter']['counter'] as $filterName => $filterArray) {
// Walk through all filters
setConfigEntry('_PRIME', 591623);
// Calculate "entropy" with the prime number (for code generation)
- setConfigEntry('_ADD', (getConfig('_PRIME') * getConfig('_PRIME') / (pi() * getConfig('code_length') + 1)));
+ setConfigEntry('_ADD', (getPrime() * getPrime() / (pi() * getConfig('code_length') + 1)));
// Simply init the randomizer with seed and _ADD value
mt_srand(generateSeed() + getConfig('_ADD'));
//* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.print_r($matches, true).'</pre>');
// Default is from outputHtml()
- $outputMode = getOutputMode();
+ $outputMode = getScriptOutputMode();
// Some entries found?
if ((count($matches) > 0) && (count($matches[3]) > 0)) {
} // END - if
// Do we have non-HTML mode?
- if ((getOutputMode() != '0') || ($outputMode != '0')) $code = decodeEntities($code);
+ if ((getScriptOutputMode() != '0') || ($outputMode != '0')) $code = decodeEntities($code);
// Return compiled code
//* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.($code).'</pre>');
// Load more reset scripts
function FILTER_RUN_RESET_INCLUDES () {
// Is the reset set or old sql_patches?
- if (((!isResetModeEnabled()) || (!isExtensionInstalled('sql_patches'))) && (getOutputMode() == '0')) {
+ if (((!isResetModeEnabled()) || (!isExtensionInstalled('sql_patches'))) && (getScriptOutputMode() == '0')) {
// Then abort here
debug_report_bug(__FUNCTION__, __LINE__, 'Cannot run reset! enabled='.intval(isResetModeEnabled()).',ext='.intval(isExtensionInstalled('sql_patches')).' Please report this bug. Thanks');
} // END - if
$currWeek = getWeek();
// Has it changed?
- if ((getConfig('last_week') != $currWeek) || ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'))) {
+ if ((getConfig('last_week') != $currWeek) || (isWeeklyResetDebugEnabled())) {
// Include weekly reset scripts
mergeIncludePool('reset', getArrayFromDirectory('inc/weekly/', 'weekly_'));
- // Update config
- if ((!isConfigEntrySet('DEBUG_WEEKLY')) || (getConfig('DEBUG_WEEKLY') != 'Y')) updateConfiguration('last_week', $currWeek);
+ // Update config if not in debug mode
+ if (!isWeeklyResetDebugEnabled()) updateConfiguration('last_week', $currWeek);
} // END - if
// Create current month mark
$currMonth = getMonth();
// Has it changed?
- if ((getConfig('last_month') != $currMonth) || ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'))) {
+ if ((getConfig('last_month') != $currMonth) || (isMonthlyResetDebugEnabled())) {
// Include monthly reset scripts
mergeIncludePool('reset', getArrayFromDirectory('inc/monthly/', 'monthly_'));
// Update config
- if ((!isConfigEntrySet('DEBUG_MONTHLY')) || (getConfig('DEBUG_MONTHLY') != 'Y')) updateConfiguration('last_month', $currMonth);
+ if (!isMonthlyResetDebugEnabled()) updateConfiguration('last_month', $currMonth);
} // END - if
} // END - if
} // END - if
// Get all values
- if ((getOutputMode() != 1) && (getOutputMode() != -1)) {
+ if ((getScriptOutputMode() != 1) && (getScriptOutputMode() != -1)) {
// Fix module
if (!isModuleSet()) {
// Is the request element set?
if (isGetRequestParameterSet('module')) {
// Set module from request
setModule(getRequestParameter('module'));
- } elseif (getOutputMode() == '0') {
+ } elseif (getScriptOutputMode() == '0') {
// Set default module 'index'
setModule('index');
} else {
// Set default 'what' value
//* DEBUG: */ debugOutput('-' . getModule() . '/' . getWhat() . '-');
- if ((!isWhatSet()) && (!isActionSet()) && (getOutputMode() != 1) && (getOutputMode() != -1)) {
+ if ((!isWhatSet()) && (!isActionSet()) && (getScriptOutputMode() != 1) && (getScriptOutputMode() != -1)) {
if (getModule() == 'admin') {
// Set 'action' value to 'login' in admin menu
setAction(getActionFromModuleWhat(getModule(), getWhat()));
// Sends out pooled mails
function FILTER_TRIGGER_SENDING_POOL () {
// Are we in normal output mode?
- if (getOutputMode() != 0) {
+ if (getScriptOutputMode() != 0) {
// Only in normal output mode to prevent race-conditons!
} // END - if
if ((!isInstalled()) || (!isConfigEntrySet('patch_level'))) return;
// Check for patch level differences between databases and current hard-coded
- if ((getConfig('CURR_SVN_REVISION') > getConfig('patch_level')) || (getConfig('patch_level') == 'CURR_SVN_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) {
+ if ((getCurrSvnRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURR_SVN_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) {
// Update database and CONFIG array
- updateConfiguration(array('patch_level', 'patch_ctime'), array(getConfig('CURR_SVN_REVISION'), 'UNIX_TIMESTAMP()'));
- setConfigEntry('patch_level', getConfig('CURR_SVN_REVISION'));
+ updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrSvnRevision(), 'UNIX_TIMESTAMP()'));
+ setConfigEntry('patch_level', getCurrSvnRevision());
setConfigEntry('patch_ctime', time());
} // END - if
}
if ((isInstallationPhase()) || (!isInstalled()) || (!isAdminRegistered()) || (!isExtensionInstalled('sql_patches'))) return;
// Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
- if (((getDay(getConfig('last_update')) != getDay()) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getOutputMode() != 1)) {
+ if (((getDay(getConfig('last_update')) != getDay()) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getScriptOutputMode() != 1)) {
// Tell every module we are in reset-mode!
doReset();
} // END - if
// Handles fatal errors
function FILTER_HANDLE_FATAL_ERRORS () {
// Do we have errors to handle and right output mode?
- if ((!ifFatalErrorsDetected()) || (getOutputMode() != '0')) {
+ if ((!ifFatalErrorsDetected()) || (getScriptOutputMode() != '0')) {
// Abort executing here
return false;
} // END - if
function FILTER_DISPLAY_PARSING_TIME () {
// Shall we display the parsing time and number of queries?
// 1234 5 54 4 5 5 4 4 5 543 3 4432 2 33 2 2 21
- if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestParameterSet('frame'))) || (isInstallationPhase())) && (getOutputMode() == '0') && ($GLOBALS['header_sent'] == 2)) {
+ if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestParameterSet('frame'))) || (isInstallationPhase())) && (getScriptOutputMode() == '0') && ($GLOBALS['header_sent'] == 2)) {
// Then display it here
displayParsingTime();
} // END - if