Beispiel #1
0
 public function response($status, $txt)
 {
     switch ($this->handler) {
         case 'json':
             $resp = msAPI::encode(array('status' => $status, 'message' => $txt));
             break;
         case 'xml':
             $resp = '<?xml version="1.0" encoding="' . $this->xml_charset . '"?><msapi><status>' . $status . '</status><message>' . $txt . '</message></msapi>';
             break;
     }
     switch ($status) {
         case 'OK':
             msAPI::log($resp);
             break;
         default:
             msAPI::log('[' . strtoupper($this->handler) . '] ' . $txt);
             break;
     }
     echo $resp;
     exit;
 }