X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fstats-functions.php;h=b4fd58326db00066c8d41ddd3f656c3b5b65d60a;hp=598ca9b5a4e23a510db68224606e8e824de14faa;hb=61621983cc6d7195fcc7eab29b5f6080ff283b34;hpb=9afd6ec5878544a7982c50ed9c0dd7de37606d5b diff --git a/inc/stats-functions.php b/inc/stats-functions.php index 598ca9b5a4..b4fd58326d 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 // Finalize it and run it - SQL_QUERY(substr($sql, 0, -1), __FUNCTION__, __LINE__); + sqlQuery(substr($sql, 0, -1), __FUNCTION__, __LINE__); } // 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'])) && (!isInstaller()) && (ifInternalStatsEnabled())) { // Write statistics to temporary table writeStatsTable(); + + // Count db/cache hits in database + updateConfiguration( + array( + 'db_hits', + 'cache_hits' + ), array( + getStatsEntry('db_hits'), + getStatsEntry('cache_hits') + ), + '+' + ); } // END - if }