Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
 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());
     }
 }