]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #7187 from MrPetovan/bug/7023-emailer-hooks
[friendica.git] / src / App.php
index 8b276414e3c82cdc76cba9e12902ef25fd7c78d6..2e357f8651a6e738aa31ab106429fcfcef6d96c6 100644 (file)
@@ -87,11 +87,6 @@ class App
         */
        private $baseURL;
 
-       /**
-        * @var bool true, if the call is from the Friendica APP, otherwise false
-        */
-       private $isFriendicaApp;
-
        /**
         * @var bool true, if the call is from an backend node (f.e. worker)
         */
@@ -154,7 +149,8 @@ class App
         */
        public function getBasePath()
        {
-               return $this->config->get('system', 'basepath');
+               // 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');
        }
 
        /**
@@ -257,8 +253,6 @@ class App
                $this->profiler = $profiler;
                $this->logger   = $logger;
 
-               $this->checkFriendicaApp();
-
                $this->profiler->reset();
 
                $this->reload();
@@ -601,28 +595,6 @@ class App
                        $this->getBaseURL();
        }
 
-       /**
-        * Checks, if the call is from the Friendica App
-        *
-        * Reason:
-        * The friendica client has problems with the GUID in the notify. this is some workaround
-        */
-       private function checkFriendicaApp()
-       {
-               // Friendica-Client
-               $this->isFriendicaApp = isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] == 'Apache-HttpClient/UNAVAILABLE (java 1.4)';
-       }
-
-       /**
-        *      Is the call via the Friendica app? (not a "normale" call)
-        *
-        * @return bool true if it's from the Friendica app
-        */
-       public function isFriendicaApp()
-       {
-               return $this->isFriendicaApp;
-       }
-
        /**
         * @brief Checks if the site is called via a backend process
         *
@@ -1017,7 +989,7 @@ class App
                        header('Refresh: 120; url=' . $this->getBaseURL() . "/" . $this->query_string);
 
                        Module\Special\HTTPException::rawContent(
-                               new HTTPException\ServiceUnavaiableException('The node is currently overloaded. Please try again later.')
+                               new HTTPException\ServiceUnavailableException('The node is currently overloaded. Please try again later.')
                        );
                }
 
@@ -1106,10 +1078,10 @@ class App
 
                // in install mode, any url loads install module
                // but we need "view" module for stylesheet
-               if ($this->getMode()->isInstall() && $this->module != 'view') {
-                       $this->module = 'install';
-               } elseif (!$this->getMode()->has(App\Mode::MAINTENANCEDISABLED) && $this->module != 'view') {
-                       $this->module = 'maintenance';
+               if ($this->getMode()->isInstall() && $this->module !== 'install') {
+                       $this->internalRedirect('install');
+               } elseif (!$this->getMode()->isInstall() && !$this->getMode()->has(App\Mode::MAINTENANCEDISABLED) && $this->module !== 'maintenance') {
+                       $this->internalRedirect('maintenance');
                } else {
                        $this->checkURL();
                        Core\Update::check($this->getBasePath(), false, $this->getMode());