public function beforeRun() { $this->request = Request::createFromGlobals(false); $this->response = new Response(); if (!$this->authenticate()) { $msg = new Message(); $msg->setSuccess(false)->addError('Wrong authentication hash'); return $this->respondMessage($msg); } }
/** * Function called before any method in controller * * @author Krzysztof Kalkhoff * */ public function beforeRun() { $this->response = new Response(); $this->request = Request::createFromGlobals(); }