]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #10178 from nupplaphil/fix/10174
[friendica.git] / src / App.php
index de8311848969c079ad530122c5c81c776fbad87d..772d273c521f7e1555a9e121b009a6cc0106bfaa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,6 +24,8 @@ namespace Friendica;
 use Exception;
 use Friendica\App\Arguments;
 use Friendica\App\BaseURL;
+use Friendica\App\Module;
+use Friendica\Module\Maintenance;
 use Friendica\Security\Authentication;
 use Friendica\Core\Config\Cache;
 use Friendica\Core\Config\IConfig;
@@ -445,11 +447,6 @@ 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() && !$this->mode->isBackend()) {
                                $requester = HTTPSignature::getSigner('', $_SERVER);
                                if (!empty($requester)) {
@@ -504,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);
@@ -549,9 +544,13 @@ 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, $this->profiler, $_SERVER, $_POST);