public function display() { if (Config::get('server_mode') == 'Http') { Utils::header("Content-Type", "text/xml; charset=utf-8"); echo $this->xmlEncode(); return null; } return $this->xmlEncode(); }
public function display() { if (Config::get('server_mode') == 'Http') { Utils::header('Content-Type', 'application/amf; charset=utf-8'); echo \amf3_encode($this->model); } else { return \amf3_encode($this->model); } }
public function display() { $pack = new MessagePacker(); $pack->writeString(json_encode($this->model)); if (Config::get('server_mode') == 'Http') { Utils::header("Content-Type", "application/zpack; charset=utf-8"); echo $pack->getData(); } else { return array($this->model, $pack->getData); } }
public function display() { if (Config::get('server_mode') == 'Http') { Utils::header("Content-Type", "text/plain; charset=utf-8"); if (\is_string($this->model)) { echo $this->model; } else { echo json_encode($this->model); } return null; } return $this->model; }
public function display() { if (Config::get('server_mode') == 'Http') { $data = \json_encode($this->model); if (isset($_GET['jsoncallback'])) { Utils::header("Content-Type", 'application/x-javascript; charset=utf-8'); echo $_GET['jsoncallback'] . '(' . $data . ')'; } else { Utils::header("Content-Type", "application/json; charset=utf-8"); echo $data; } } else { return \json_encode($this->model); } }
public function display() { $jsonData = \json_encode($this->model); $data = gzencode($jsonData); $pack = new MessagePacker(); $len = strlen($data); $pack->writeInt($len + 16); $pack->writeInt($this->model['cmd']); $pack->writeInt($this->model['rid']); $pack->writeString($data, $len); if (Config::get('server_mode') == 'Http') { Utils::header("Content-Type", "application/zrpack; charset=utf-8"); echo $pack->getData(); } else { return array($jsonData, $pack->getData()); } }