X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConsole%2FGlobalCommunityBlock.php;h=d11aa6cf86ee0170be1f5a14fe007668739c7495;hb=24d7ffa3fee7e3686589f29f005fb2c419c9985a;hp=aebb0a2d7c3fb2a21868ad17f12b42947bbf9c58;hpb=850d9b4c0b595e00e5cd7ec40a2e8c0f0569738f;p=friendica.git diff --git a/src/Core/Console/GlobalCommunityBlock.php b/src/Core/Console/GlobalCommunityBlock.php index aebb0a2d7c..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,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->getMode()->isInstall()) { + throw new \RuntimeException('Database isn\'t ready or populated yet'); } $contact_id = Contact::getIdForURL($this->getArgument(0));