X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConsole%2FGlobalCommunityBlock.php;h=d11aa6cf86ee0170be1f5a14fe007668739c7495;hb=24d7ffa3fee7e3686589f29f005fb2c419c9985a;hp=26c5d13131467bb1d98cb7b9d8956e4360d2aff0;hpb=b48df6a82831dfb1f003fb80f58a80df29e0cc61;p=friendica.git diff --git a/src/Core/Console/GlobalCommunityBlock.php b/src/Core/Console/GlobalCommunityBlock.php index 26c5d13131..d11aa6cf86 100644 --- a/src/Core/Console/GlobalCommunityBlock.php +++ b/src/Core/Console/GlobalCommunityBlock.php @@ -13,8 +13,8 @@ use Friendica\Model\Contact; * * License: AGPLv3 or later, same as Friendica * - * @author Tobias Diekershoff - * @author Hypolite Petovan + * @author Tobias Diekershoff + * @author Hypolite Petovan */ class GlobalCommunityBlock extends \Asika\SimpleConsole\Console { @@ -39,7 +39,7 @@ HELP; protected function doExecute() { - $a = get_app(); + $a = \get_app(); if ($this->getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -56,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->getMode()->isInstall()) { + throw new \RuntimeException('Database isn\'t ready or populated yet'); } $contact_id = Contact::getIdForURL($this->getArgument(0));