X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConsole%2FGlobalCommunityBlock.php;h=f51ed95fe2b4f49d93406317dca55d47c6e7eb3e;hb=9fbaaa1481a609563e00a40db64bdce5e02c5524;hp=26c5d13131467bb1d98cb7b9d8956e4360d2aff0;hpb=5e5fde0a63c57d2873bfa29404110269ca9abeee;p=friendica.git diff --git a/src/Core/Console/GlobalCommunityBlock.php b/src/Core/Console/GlobalCommunityBlock.php index 26c5d13131..f51ed95fe2 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 { @@ -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->isInstallMode()) { + throw new \RuntimeException('Database isn\'t ready or populated yet'); } $contact_id = Contact::getIdForURL($this->getArgument(0));