get("logistics.tracking.$code.$carrier"); if ($cacheresp !== false && empty($VARS["nocache"])) { exitWithJson(downgradeResponseVersion(json_decode($cacheresp, true), $revision)); } $trackinginfo = Tracking::track($code, $carrier); } catch (TrackingException $ex) { if (env("debugmode", false)) { echo $ex->getTraceAsString(); } $output = [ "status" => "ERROR", "msg" => $ex->getMessage() ]; $memcache->set("logistics.tracking.$code.$carrier", json_encode($output), 60 * 10); exitWithJson(downgradeResponseVersion($output, $revision)); } if (is_null($trackinginfo)) { sendJsonResp("Could not find any results for that tracking code.", "ERROR"); } $output = $trackinginfo->toObject(); $memcache->set("logistics.tracking.$code.$carrier", json_encode($output), 60 * 60); exitWithJson($output);