X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fstats-functions.php;h=a965d71c155d583598a8b2fb052e26ba1bfdd02c;hb=ca11996eb52fa0a1ec45d6ab10f5331c4a54a116;hp=343a7c510c7284794fb4176ccb5230a0a2a7abc9;hpb=f8cc979307416fbd9b27908ec461004a3feb9387;p=mailer.git diff --git a/inc/stats-functions.php b/inc/stats-functions.php index 343a7c510c..a965d71c15 100644 --- a/inc/stats-functions.php +++ b/inc/stats-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -64,7 +64,8 @@ function isStatsEntrySet ($entry) { // Increments a statistics entry function incrementStatsEntry ($entry, $amount=1) { // Do we have stats enabled? - if (!ifInternalStatsEnabled()) { + if ((!ifInternalStatsEnabled()) && ($entry != 'db_hits')) { + // Abort here return; } // END - if @@ -74,7 +75,7 @@ function incrementStatsEntry ($entry, $amount=1) { $GLOBALS['stats'][$entry] += $amount; } else { // Write it - $GLOBALS['stats'][$entry] = $amount; + setStatsEntry($entry, $amount); } } @@ -179,6 +180,18 @@ function FILTER_FLUSH_STATS () { if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (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 }