]> git.mxchange.org Git - mailer.git/blobdiff - inc/stats-functions.php
Call-back function names shortened, __FUNCTION__ used:
[mailer.git] / inc / stats-functions.php
index 338f3b833adab7d1920438ea6c89e070d8c4b6a3..3190a6d9ab3388885ebb67dfaa2a8fa7d3b28a74 100644 (file)
@@ -45,7 +45,7 @@ if (!defined('__SECURITY')) {
 // 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();
 
@@ -66,7 +66,7 @@ function isStatsEntrySet ($entry) {
 // Increments a statistics entry
 function incrementStatsEntry ($entry, $amount=1) {
        // Do we have stats enabled?
-       if (getConfig('STATS_ENABLED') != 'Y') return;
+       if (!ifStatsAreEnabled()) return;
 
        // Is it there?
        if (isStatsEntrySet($entry)) {
@@ -110,8 +110,10 @@ function loadStatsTable () {
        } // END - if
 
        // Load it from database
-       $result = SQL_QUERY_ESC("SELECT `stats_entry`,`stats_value` FROM `{?_MYSQL_PREFIX?}_stats_%s` ORDER BY `stats_entry` ASC",
-               array(generateDateTime(time(), '6')), __FUNCTION__, __LINE__);
+       $result = SQL_QUERY_ESC("SELECT `stats_entry`, `stats_value` FROM `{?_MYSQL_PREFIX?}_stats_%s` ORDER BY `stats_entry` ASC",
+               array(
+                       generateDateTime(time(), '6')
+               ), __FUNCTION__, __LINE__);
 
        // Read all rows
        while ($row = SQL_FETCHARRAY($result)) {
@@ -174,7 +176,7 @@ function writeStatsTable () {
 // 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