Beispiel #1
0
 public function run()
 {
     $this->initAll();
     try {
         //todo 按模块 判断 ,错误时输出json或者html页面
         $response = $this->handle();
         echo $response->getContent();
     } catch (\Exception $e) {
         if ($e instanceof \Library\AjaxException) {
             \Plugins\Common::echoError($e->getCode(), $e->getMessage());
         } else {
             echo get_class($e), ": ", $e->getMessage(), "\n";
             echo " File=", $e->getFile(), "\n";
             echo " Line=", $e->getLine(), "\n";
             echo $e->getTraceAsString();
         }
     }
 }