- Author:
- David Nickerson <david.nickerson@gmail.com>
- Date:
- 2021-09-17 15:39:51+12:00
- Desc:
- tweak html formatting
- Permanent Source URI:
- https://models.fieldml.org/workspace/a1/rawfile/c47db6b2fedb368422c7f4d5191aeb9f319ad684/dojo-presentation/js/dojo/dojox/analytics/logger/dojoxAnalytics.php
<?php
require_once("./JSON.php");
$filename = "./logs/analytics.log";
$json = new Services_JSON;
$id = $_REQUEST["id"];
$items = $json->decode($_REQUEST["data"]);
if (!$handle = fopen($filename, 'a+')) {
print '{error: "server error"}';
exit;
}
foreach($items as $i=>$item){
$item->_analyticsId = $id;
$item->_analyticsTimeStamp = time();
$log = $json->encode($item) . "\n";
fwrite($handle, $log);
}
fclose($handle);
$response = "{'eventsRecieved': '" . sizeof($items) . "', 'id': '" . $id . "'}";
if ($_REQUEST["callback"]){
print $_REQUEST["callback"] . "(" . $response . ");";
}else{
print $response;
}
?>