summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting/hooks/cron.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics_reporting/hooks/cron.inc.php')
-rw-r--r--modules-available/statistics_reporting/hooks/cron.inc.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/modules-available/statistics_reporting/hooks/cron.inc.php b/modules-available/statistics_reporting/hooks/cron.inc.php
index 14597f7d..7336b7d1 100644
--- a/modules-available/statistics_reporting/hooks/cron.inc.php
+++ b/modules-available/statistics_reporting/hooks/cron.inc.php
@@ -1,25 +1,23 @@
<?php
-if (RemoteReport::isReportingEnabled()) {
- $nextReporting = RemoteReport::getReportingTimestamp();
+$nextReporting = RemoteReport::getReportingTimestamp();
- // It's time to generate a new report
- while ($nextReporting <= time()) {
- RemoteReport::writeNextReportingTimestamp();
+// It's time to generate a new report
+while ($nextReporting <= time()) {
+ RemoteReport::writeNextReportingTimestamp();
- $to = $nextReporting;
+ $to = $nextReporting;
- $statisticsReport = json_encode(RemoteReport::generateReport($to));
+ $statisticsReport = json_encode(RemoteReport::generateReport($to));
- $params = array("action" => "statistics", "data" => $statisticsReport);
+ $params = array("action" => "statistics", "data" => $statisticsReport);
- $result = Download::asStringPost(CONFIG_REPORTING_URL, $params, 30, $code);
+ $result = Download::asStringPost(CONFIG_REPORTING_URL, $params, 30, $code);
- if ($code != 200) {
- EventLog::warning("Statistics Reporting failed: " . $code, $result);
- } else {
- EventLog::info('Statistics report sent to ' . CONFIG_REPORTING_URL);
- }
- $nextReporting = strtotime("+7 days", $nextReporting);
+ if ($code != 200) {
+ EventLog::warning("Statistics Reporting failed: " . $code, $result);
+ } else {
+ EventLog::info('Statistics report sent to ' . CONFIG_REPORTING_URL);
}
-} \ No newline at end of file
+ $nextReporting = strtotime("+7 days", $nextReporting);
+}