Sha256: 51e1d76c8a22a23021ceef150d208406b46e80a8c909eeb082c60b0aaa7a2ed6
Contents?: true
Size: 648 Bytes
Versions: 8
Compression:
Stored size: 648 Bytes
Contents
<?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; } ?>
Version data entries
8 entries across 8 versions & 1 rubygems