/** * 启动控制器 * * @param string $uri 路径 * * @return Controller */ public static function run($uri) { $c = new self($uri); $c->cutURI(); $c->dispatch(); try { $c->execute(); } catch (\Exception $e) { Error::exceptionHandler($e); } finally { if ($c->outputAllow) { Responder::write(); } } return $c; }