public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new LoginManager(SessionStorageProvider::getInstance(), Request::getInstance(), LazyServerConnection::getInstance()); } return self::$instance; }
public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new ServerManager(SessionStorageProvider::getInstance(), Request::getInstance(), FajrConfigLoader::getConfiguration()); } return self::$instance; }
/** * Runs the whole logic. It is fajr's main() * * @returns void */ public function run() { $response = null; try { $trace = TraceProvider::getInstance(); $this->request = Request::getInstance(); $this->setResponseFields($this->request); $response = $this->runLogic($trace); } catch (SecurityException $e) { $this->logSecurityException($e); if (!$this->config->get('Debug.Exception.ShowStacktrace')) { die("Internal error"); } else { die($e); } } catch (Exception $e) { $response = $this->renderExceptionResponse($e); // Note: We MUST unset this exception, because it's // stacktrace holds cyclic references to context // and therefore the order of destruction of all objects // is really random. unset($e); } if ($response == null) { $response = new \Symfony\Component\HttpFoundation\Response('Response missing', 500); $response->headers->set('Content-Type', 'text/html;charset=UTF-8'); } if ($trace !== null) { $trace->tlog("everything done"); } $this->adjustResponse($response); $response->prepare(\Symfony\Component\HttpFoundation\Request::createFromGlobals()); $response->send(); }