*/
class App
{
+ const MODE_NORMAL = 0;
+ const MODE_INSTALL = 1;
+ const MODE_MAINTENANCE = 2;
+
public $module_loaded = false;
public $module_class = null;
public $query_string;
public $argv;
public $argc;
public $module;
- public $install_mode = false;
+ public $mode = App::MODE_NORMAL;
public $pager;
public $strings;
public $basepath;
// 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;
}
return $sender_email;
}
+
+ /**
+ * @note Checks, if the App is in the Maintenance-Mode
+ *
+ * @return boolean
+ */
+ public function checkMaintenanceMode()
+ {
+ if (Config::get('system', 'maintenance')) {
+ $this->mode = App::MODE_MAINTENANCE;
+ return true;
+ }
+
+ return false;
+ }
}