+ header("Content-Type: application/json");
+ echo json_encode($statistics);
+ logger("statistics_init: printed ".print_r($statistics, true));
+ killme();
+}
+
+function statistics_json_cron($a,$b) {
+ $last = get_config('statistics_json','last_calucation');
+
+ if($last) {
+ // Calculate all 3 hours
+ $next = $last + (180 * 60);
+ if($next > time()) {
+ logger('statistics_json_cron: calculation intervall not reached');
+ // return;
+ }
+ }
+ logger('statistics_json_cron: cron_start');
+
+