X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fstats-functions.php;h=d863ccd068978f9052d150ad38dd368fa458bc36;hb=c9b17a86f4d62b50b8b1fbe6f9d88e6092430526;hp=da5815c1828dd854afd4978e41f72165b3fa11a3;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git diff --git a/inc/stats-functions.php b/inc/stats-functions.php index da5815c182..d863ccd068 100644 --- a/inc/stats-functions.php +++ b/inc/stats-functions.php @@ -1,7 +1,7 @@ $value) { + $sql .= sprintf("('%s', %s),", $entry, bigintval($value)); + } // END - foreach + + // Finalize it and run it + SQL_QUERY(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')) { - // Then prepare it for writing - foreach ($GLOBALS['stats'] as $key=>$value) { - $stats[] = '$GLOBALS[\'stats\'][\'' . $key . '\'] = ' . $value . ';'; - } // END - foreach - - // Add empty line - $stats[] = ''; - - // And flush all out - writeToFile($GLOBALS['stats_fqfn'], implode("\n", $stats), true); + if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifStatsAreEnabled())) { + // Write statistics to temporary table + writeStatsTable(); } // END - if }