Beispiel #1
0
 public function execute()
 {
     if (isset($this->data) && !empty($this->data)) {
         $json = $this->data;
         if (isset($this->object)) {
             if (is_object($this->object)) {
                 $json[strtolower(get_class($this->object))] = $this->object;
             } else {
                 $json[] = $this->object;
             }
         }
     } else {
         $json = $this->object;
     }
     echo json_encode($json);
     App::killModule('UbenchModule');
 }
Beispiel #2
0
 public function execute()
 {
     $json = array();
     $json['status'] = $this->statusCode;
     $json['message'] = $this->message;
     if (isset($this->data) && !empty($this->data)) {
         $json['data'] = $this->data;
     }
     if (isset($this->params)) {
         $json['data'] = array();
         if (is_array($this->params)) {
             foreach ($this->params as $key => $value) {
                 $json['data'][$key] = $value;
             }
         } else {
             $json['data'] = $this->params;
         }
     }
     echo json_encode($json);
     App::killModule('UbenchModule');
 }