]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/Maintenance.php
Merge pull request #5599 from annando/postupdate
[friendica.git] / src / Core / Console / Maintenance.php
index cf0a468ff6fcf1b196ef80527cf664d2f8e369d7..90449c47879b6cafb014433d9371e26412691ddf 100644 (file)
@@ -47,6 +47,8 @@ HELP;
 
        protected function doExecute()
        {
+               $a = get_app();
+
                if ($this->getOption('v')) {
                        $this->out('Class: ' . __CLASS__);
                        $this->out('Arguments: ' . var_export($this->args, true));
@@ -62,12 +64,8 @@ HELP;
                        throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
                }
 
-               require_once '.htconfig.php';
-               $result = \dba::connect($db_host, $db_user, $db_pass, $db_data);
-               unset($db_host, $db_user, $db_pass, $db_data);
-
-               if (!$result) {
-                       throw new \RuntimeException('Unable to connect to database');
+               if ($a->isInstallMode()) {
+                       throw new \RuntimeException('Database isn\'t ready or populated yet');
                }
 
                Core\Config::load();