// Init stats system
function initStatsSystem () {
// Is stats cache loaded?
- if ((!isset($GLOBALS['stats_loaded'])) && (getConfig('STATS_ENABLED') == 'Y')) {
+ if ((!isset($GLOBALS['stats_loaded'])) && (ifStatsAreEnabled())) {
// Init statistics array
$GLOBALS['stats'] = array();
// Increments a statistics entry
function incrementStatsEntry ($entry, $amount=1) {
// Do we have stats enabled?
- if (getConfig('STATS_ENABLED') != 'Y') return;
+ if (getConfig('stats_enabled') != 'Y') return;
// Is it there?
if (isStatsEntrySet($entry)) {
// Filter for flushing statistics
function FILTER_FLUSH_STATS () {
// Now do we have stats?
- if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (getConfig('STATS_ENABLED') == 'Y')) {
+ if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifStatsAreEnabled())) {
// Write statistics to temporary table
writeStatsTable();
} // END - if
}
+// Check wether stats are enabled
+function ifStatsAreEnabled () {
+ logDebugMessage(__FUNCTION__, __LINE__, 'CALLED!');
+
+ // Do we have cache?
+ if (!isset($GLOBALS['stats_enabled'])) {
+ // Then determine it
+ $GLOBALS['stats_enabled'] = (getConfig('stats_enabled') == 'Y');
+ } // END - if
+
+ // Return cached value
+ return $GLOBALS['stats_enabled'];
+}
+
// [EOF]
?>