} // 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'));
$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
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
}