X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fstats-functions.php;h=5d8c441f48a860fed2ca0838cc7b5ac0cec9d25d;hb=ac293991d427918ec28531221ed2b34cbb03caef;hp=baa0b130b1f0f24714685c12fa1bc650fba7308a;hpb=3ec2d6f962c617af33b0e95e22eb414312e3ffb6;p=mailer.git diff --git a/inc/stats-functions.php b/inc/stats-functions.php index baa0b130b1..5d8c441f48 100644 --- a/inc/stats-functions.php +++ b/inc/stats-functions.php @@ -1,7 +1,7 @@ $value) { + foreach ($GLOBALS['stats'] as $entry => $value) { $sql .= sprintf("('%s', %s),", $entry, bigintval($value)); } // END - foreach @@ -161,11 +176,25 @@ function writeStatsTable () { // Filter for flushing statistics function FILTER_FLUSH_STATS () { // Now do we have stats? - if ((isset($GLOBALS['stats'])) && (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] ?>