Beispiel #1
0
 function run()
 {
     try {
         $this->_filter->routeStartup();
         //路由开始
         $action = $this->_router->route();
         $action = $this->_filter->routeShutdown($action);
         //路由关闭
         $action = $this->_filter->dispatchStartup($action);
         //方法调度
         $method = $action->_method;
         $action->{$method}();
         $this->_filter->dispatchShutdown();
         //方法调度完成
         $action->response();
         $this->_filter->endReturn();
         //返回结果
     } catch (CException $e) {
         //异常处理
         if ($e->exceptionType == 'biz') {
             //业务逻辑异常--抛到业务层处理
             $actionclass = $e->exActionMethod . '_Action';
             $action = CFactory::instance($actionclass, $e->params, true, true);
             $method = $action->_method;
             $action->{$method}();
             $action->response();
             $this->_filter->endReturn();
             //返回结果
         } else {
             //核心异常--直接抛出异常
             throw new Exception($e);
         }
     }
 }