X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=772d273c521f7e1555a9e121b009a6cc0106bfaa;hb=15caf4b3f7eacda399a56b1ad8eeb9d3257306d9;hp=65ae3fe2f47389583dc0286733f1d4a2c528b990;hpb=fb7f7435c080e15bdafbbcbb5a3dfd94ef8dd952;p=friendica.git diff --git a/src/App.php b/src/App.php index 65ae3fe2f4..772d273c52 100644 --- a/src/App.php +++ b/src/App.php @@ -1,6 +1,6 @@ profiler->set($start_time, 'start'); + $this->profiler->set(microtime(true), 'classinit'); + $moduleName = $module->getName(); try { @@ -443,12 +447,7 @@ class App Core\Hook::callAll('init_1'); } - // Exclude the backend processes from the session management - if ($this->mode->isBackend()) { - Core\Worker::executeIfIdle(); - } - - if ($this->mode->isNormal()) { + if ($this->mode->isNormal() && !$this->mode->isBackend()) { $requester = HTTPSignature::getSigner('', $_SERVER); if (!empty($requester)) { Profile::addVisitorCookieForHandle($requester); @@ -456,7 +455,7 @@ class App } // ZRL - if (!empty($_GET['zrl']) && $this->mode->isNormal()) { + if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend()) { if (!local_user()) { // Only continue when the given profile link seems valid // Valid profile links contain a path with "/profile/" and no query parameters @@ -502,8 +501,6 @@ class App // but we need "view" module for stylesheet if ($this->mode->isInstall() && $moduleName !== 'install') { $this->baseURL->redirect('install'); - } elseif (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'maintenance') { - $this->baseURL->redirect('maintenance'); } else { $this->checkURL(); Core\Update::check($this->getBasePath(), false, $this->mode); @@ -547,17 +544,21 @@ class App // Initialize module that can set the current theme in the init() method, either directly or via App->profile_uid $page['page_title'] = $moduleName; - // determine the module class and save it to the module instance - // @todo there's an implicit dependency due SESSION::start(), so it has to be called here (yet) - $module = $module->determineClass($this->args, $router, $this->config); + if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED)) { + $module = new Module('maintenance', Maintenance::class); + } else { + // determine the module class and save it to the module instance + // @todo there's an implicit dependency due SESSION::start(), so it has to be called here (yet) + $module = $module->determineClass($this->args, $router, $this->config); + } // Let the module run it's internal process (init, get, post, ...) - $module->run($this->l10n, $this->baseURL, $this->logger, $_SERVER, $_POST); + $module->run($this->l10n, $this->baseURL, $this->logger, $this->profiler, $_SERVER, $_POST); } catch (HTTPException $e) { ModuleHTTPException::rawContent($e); } - $page->run($this, $this->baseURL, $this->mode, $module, $this->l10n, $this->config, $pconfig); + $page->run($this, $this->baseURL, $this->mode, $module, $this->l10n, $this->profiler, $this->config, $pconfig); } /**