]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Add a App-Mode with defined constants
[friendica.git] / src / App.php
index 1acd35ac348c52ea8c10adf42d3b53cda0b999c7..4ad3f62b63aebabf86d48228992501b6b91d7cb8 100644 (file)
@@ -14,6 +14,10 @@ use Detection\MobileDetect;
 
 use Exception;
 
+define ('APP_MODE_NORMAL', 0);
+define ('APP_MODE_INSTALL', 1);
+define ('APP_MODE_MAINTENANCE', 2);
+
 require_once 'boot.php';
 require_once 'include/text.php';
 
@@ -52,6 +56,7 @@ class App
        public $argv;
        public $argc;
        public $module;
+       public $mode = APP_MODE_NORMAL;
        public $pager;
        public $strings;
        public $basepath;
@@ -288,6 +293,14 @@ class App
                // Register template engines
                $this->register_template_engine('Friendica\Render\FriendicaSmartyEngine');
 
+               /**
+                * Load the configuration file which contains our DB credentials.
+                * Ignore errors. If the file doesn't exist or is empty, we are running in
+                * installation mode.    *
+                */
+               $this->mode = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? APP_MODE_NORMAL : APP_MODE_INSTALL);
+
+
                self::$a = $this;
        }
 
@@ -1062,7 +1075,7 @@ class App
                                $hostname = substr($hostname, 0, strpos($hostname, ':'));
                        }
 
-                       $sender_email = L10n::t('noreply') . '@' . $hostname;
+                       $sender_email = 'noreply@' . $hostname;
                }
 
                return $sender_email;