/** * @return AuthenticationService * @throws \Exception */ protected function getAuthenticationService() { if (!$this->authenticationService instanceof AuthenticationService) { $authConfig = $this->getConfiguration()->get('authentication'); if (!is_array($authConfig)) { throw new \Exception('Authentication configuration missing', 1465583676); } $authFactory = new AuthFactory($_COOKIE); $authAdapter = $authFactory->newPdoAdapter($this->getPdo(), new PasswordVerifier(AuthenticationService::PASSWORD_HASHING_ALGO), $authConfig['columns'], $authConfig['table']); $this->authenticationService = new AuthenticationService($authFactory, $authAdapter); } return $this->authenticationService; }