]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #12673 from annando/andstatus-api
[friendica.git] / src / App.php
index b41215380f92b70d82ff00e371fdd3478c48b316..378ddbc9de032429c864b68d4835b489d6036a88 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -25,6 +25,7 @@ use Exception;
 use Friendica\App\Arguments;
 use Friendica\App\BaseURL;
 use Friendica\Capabilities\ICanCreateResponses;
+use Friendica\Content\Nav;
 use Friendica\Core\Config\Factory\Config;
 use Friendica\Core\Session\Capability\IHandleUserSessions;
 use Friendica\Database\Definition\DbaDefinition;
@@ -296,8 +297,7 @@ class App
         */
        public function getBasePath(): string
        {
-               // Don't use the basepath of the config table for basepath (it should always be the config-file one)
-               return $this->config->getCache()->get('system', 'basepath');
+               return $this->config->get('system', 'basepath');
        }
 
        /**
@@ -360,7 +360,7 @@ class App
                        $this->profiler->update($this->config);
 
                        Core\Hook::loadHooks();
-                       $loader = (new Config())->createConfigFileLoader($this->getBasePath(), $_SERVER);
+                       $loader = (new Config())->createConfigFileManager($this->getBasePath(), $_SERVER);
                        Core\Hook::callAll('load_config', $loader);
 
                        // Hooks are now working, reload the whole definitions with hook enabled
@@ -573,13 +573,14 @@ class App
         * @param IManagePersonalConfigValues $pconfig
         * @param Authentication              $auth       The Authentication backend of the node
         * @param App\Page                    $page       The Friendica page printing container
+        * @param ModuleHTTPException         $httpException The possible HTTP Exception container
         * @param HTTPInputData               $httpInput  A library for processing PHP input streams
         * @param float                       $start_time The start time of the overall script execution
         *
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, HTTPInputData $httpInput, float $start_time)
+       public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, Nav $nav, ModuleHTTPException $httpException, HTTPInputData $httpInput, float $start_time)
        {
                $this->profiler->set($start_time, 'start');
                $this->profiler->set(microtime(true), 'classinit');
@@ -659,7 +660,7 @@ class App
                                $this->baseURL->redirect('install');
                        } else {
                                $this->checkURL();
-                               Core\Update::check($this->getBasePath(), false, $this->mode);
+                               Core\Update::check($this->getBasePath(), false);
                                Core\Addon::loadAddons();
                                Core\Hook::loadHooks();
                        }
@@ -713,17 +714,17 @@ class App
                        $httpinput = $httpInput->process();
                        $input     = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
 
-                       // Let the module run it's internal process (init, get, post, ...)
+                       // Let the module run its internal process (init, get, post, ...)
                        $timestamp = microtime(true);
-                       $response = $module->run($input);
+                       $response = $module->run($httpException, $input);
                        $this->profiler->set(microtime(true) - $timestamp, 'content');
                        if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
-                               $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $this->session->getLocalUserId());
+                               $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId());
                        } else {
                                $page->exit($response);
                        }
                } catch (HTTPException $e) {
-                       (new ModuleHTTPException())->rawContent($e);
+                       $httpException->rawContent($e);
                }
                $page->logRuntime($this->config, 'runFrontend');
        }