public function __construct() { $this->view = new View(); $this->config = ApplicationRegistry::instance(); $this->request = RequestRegistry::getRequest(); $this->session = SessionRegistry::instance(); $error = $this->request->getProperty('app_error'); if (is_null($this->session->getCurrentUser()) && $this->request->getProperty('controller') != 'login' && is_null($error)) { $this->redirect('/login/'); } elseif (is_null($this->session->getCurrentUser()) && !is_null($error) && !$error instanceof \App\library\exceptions\LoginException) { $this->redirect('/login/'); } }
private function runError(\Exception $e) { try { $request = new Request(); $request->setProperty('app_error', $e); $request->setProperty('controller', 'error'); $request->setProperty('action', 'index'); RequestRegistry::setRequest($request); $cmdResolver = new CommandResolver(); $cmd = $cmdResolver->getCmd($request); $cmd->execute(); } catch (\Exception $e) { echo $e->getMessage(); exit; } }
public function __construct() { $this->config = ApplicationRegistry::instance(); $this->request = RequestRegistry::getRequest(); $this->session = SessionRegistry::instance(); }
public function __construct() { $this->init(); RequestRegistry::setRequest($this); }