Example #1
0
 /**
  * 启动程序
  */
 public function run()
 {
     //输出指定编码以及格式
     $this->res->setHeader("Content-Type", "text/html;charset=" . $this->getConfig("charset"))->sendHeader();
     set_error_handler(array($this, 'handler'));
     if ($this->getConfig('debug')) {
         $this->log->setWriter(new LogWriter());
     }
     //预处理中间件
     $this->using(new Middleware\Cookie());
     //预处理中间件执行
     if ($this->preMiddleware) {
         $this->preMiddleware->call();
     }
     $this->applyHook('before.router');
     //分组
     $this->route->applyGroup();
     $this->route->next();
     $this->applyHook('after.router');
     restore_error_handler();
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
 }