コード例 #1
0
 /**
  * 处理请求
  *
  */
 private function _handleRequest()
 {
     try {
         $context = new Context();
         $ctrl_r = new ControlResolver();
         $ctrl = $ctrl_r->getController($context);
         $ctrl->execute($context);
     } catch (\Exceptions\ResolverException $e) {
         log_message(LOG_ERR, "ResolverException:" . $e->getMessage());
         $context->err_echo("the Server ResolverException\n");
     } catch (\Exceptions\EchoException $e) {
         log_message(LOG_ERR, "EchoException:" . $e->getMessage());
         $context->err_echo("the Server EchoException\n");
     } catch (Exception $e) {
         log_message(LOG_ERR, "Exception:" . $e->getMessage());
         $context->err_echo("the Server Exception\n");
     }
 }
コード例 #2
0
 /**
  * @param $arg_path
  */
 public static function setAppPath($arg_path)
 {
     if (is_dir($arg_path)) {
         self::$_AppPath = $arg_path;
     }
 }
コード例 #3
0
ファイル: CommandTest.php プロジェクト: BPing/PHPCbping
 /**
  * 控制器无法通过过滤器异常
  *
  * @expectedException        Exceptions\ResolverException
  * @expectedExceptionMessage Command cannot pass filter
  */
 public function testNoFilter()
 {
     AppHelper::Instance()->config("CMD_FILTER", '/Controller$/');
     $_GET["cmd"] = "NoClassExist";
     $context = new Context();
     $ctrl_r = new ControlResolver();
     $ctrl = $ctrl_r->getController($context);
 }