public function run() { error_reporting(E_ALL); Session::start(); $this->initRouteService(); $this->registerDatabaseConfiguration(); if (Csrf::getCSRFToken() == null) { Csrf::setCSRFToken(); } $this->loadRoles(); // RouteScanner::performScan(); $this->frontController = new FrontController(new Router()); $this->frontController->dispatch(); }
private function invokeTheRoute() { $this->isBannedByIP(); $this->checkRequestMethod(); $this->checkAuthorization(); $this->checkActionSignature(); try { call_user_func_array(array($this->getController(), $this->getRouter()->getAction()), $this->getRouter()->routeParams); } catch (\Exception $e) { echo $e->getMessage(); } if (Request::needToChangeCsrf()) { Csrf::setCSRFToken(); } }