コード例 #1
0
 public function output()
 {
     global $gJCoord;
     $this->_httpHeaders['Content-Type'] = "application/json";
     if ($gJCoord->request->jsonRequestId !== null) {
         $content = jJsonRpc::encodeResponse($this->response, $gJCoord->request->jsonRequestId);
         $this->_httpHeaders['Content-length'] = strlen($content);
         $this->sendHttpHeaders();
         echo $content;
     } else {
         $this->_httpHeaders['Content-length'] = '0';
         $this->sendHttpHeaders();
     }
     return true;
 }
コード例 #2
0
 public function output()
 {
     if ($this->_outputOnlyHeaders) {
         $this->sendHttpHeaders();
         return true;
     }
     $this->_httpHeaders['Content-Type'] = "application/json";
     $req = jApp::coord()->request;
     if ($req->jsonRequestId !== null) {
         $content = jJsonRpc::encodeResponse($this->response, $req->jsonRequestId);
         $this->_httpHeaders['Content-length'] = strlen($content);
         $this->sendHttpHeaders();
         echo $content;
     } else {
         $this->_httpHeaders['Content-length'] = '0';
         $this->sendHttpHeaders();
     }
     return true;
 }