/**
  * Returns the error jsonrpc data to the client
  * @param array $optional_data An optional array of key=>value pairs that should be included
  * in the array response. Must not contain the keys "error" and "id"
  */
 public function sendAndExit($optional_data = array())
 {
     $ret = array_merge(array("error" => $this->getData(), "id" => $this->getId()), $optional_data);
     $json = new JsonWrapper();
     if (handleQooxdooDates) {
         $json->useJsonClass();
         $this->sendReply($json->encode($ret));
     } else {
         $this->sendReply($json->encode($ret));
     }
     exit;
 }
Example #2
0
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new JsonWrapper();
     }
     return self::$instance;
 }