]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/GlobalCommunityBlock.php
Merge pull request #5599 from annando/postupdate
[friendica.git] / src / Core / Console / GlobalCommunityBlock.php
index aebb0a2d7c3fb2a21868ad17f12b42947bbf9c58..59a5d9cfdc1ce99daa23eb813e940c62de14b5de 100644 (file)
@@ -39,6 +39,8 @@ HELP;
 
        protected function doExecute()
        {
+               $a = get_app();
+
                if ($this->getOption('v')) {
                        $this->out('Class: ' . __CLASS__);
                        $this->out('Arguments: ' . var_export($this->args, true));
@@ -54,12 +56,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');
                }
 
                $contact_id = Contact::getIdForURL($this->getArgument(0));