get("logistics.tracking.$code.$carrier"); if ($cacheresp !== false && empty($VARS["nocache"])) { exitWithJson(json_decode($cacheresp, true)); } $trackinginfo = Tracking::track($code, $carrier); } catch (TrackingException $ex) { $output = [ "status" => "ERROR", "msg" => $ex->getMessage() ]; $memcache->set("logistics.tracking.$code.$carrier", json_encode($output), 60 * 10); exitWithJson($output); } 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);