public function run() { $this->res = new Response(); try { $params = $this->checkRoute($this->req->getRequestUri()); $this->checkAccess($params['module'], $params['controller']); $this->req->setParams($params); if (empty($params['cacheTime']) || !$this->conf['cache']['enabled']) { $content = $this->runController($params); } else { $this->res->setCacheHeader($params['cacheTime']); $content = $this->runController($params, $params['cacheTime']); } } catch (Exception $e) { $content = $e->process($this); } $this->res->setContent($content); $this->res->sendContent(); }