]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/GlobalCommunitySilence.php
Merge pull request #5599 from annando/postupdate
[friendica.git] / src / Core / Console / GlobalCommunitySilence.php
index ccd6014e9c727bfbd7f9731d7d0723c445b6c557..2b25d84433cf0fbe2f51ecc8772a13bc2f571a8b 100644 (file)
@@ -3,8 +3,9 @@
 namespace Friendica\Core\Console;
 
 use Friendica\Core\Protocol;
-use Friendica\Database\DBM;
+use Friendica\Database\DBA;
 use Friendica\Network\Probe;
+use RuntimeException;
 
 require_once 'include/text.php';
 
@@ -65,7 +66,7 @@ HELP;
                }
 
                if ($a->isInstallMode()) {
-                       throw new \RuntimeException('Database isn\'t ready or populated yet');
+                       throw new RuntimeException('Database isn\'t ready or populated yet');
                }
 
                /**
@@ -75,16 +76,16 @@ HELP;
                 * */
                $net = Probe::uri($this->getArgument(0));
                if (in_array($net['network'], [Protocol::PHANTOM, Protocol::MAIL])) {
-                       throw new \RuntimeException('This account seems not to exist.');
+                       throw new RuntimeException('This account seems not to exist.');
                }
 
                $nurl = normalise_link($net['url']);
-               $contact = \dba::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
-               if (DBM::is_result($contact)) {
-                       \dba::update("contact", ["hidden" => true], ["id" => $contact["id"]]);
+               $contact = DBA::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
+               if (DBA::isResult($contact)) {
+                       DBA::update("contact", ["hidden" => true], ["id" => $contact["id"]]);
                        $this->out('NOTICE: The account should be silenced from the global community page');
                } else {
-                       throw new \RuntimeException('NOTICE: Could not find any entry for this URL (' . $nurl . ')');
+                       throw new RuntimeException('NOTICE: Could not find any entry for this URL (' . $nurl . ')');
                }
 
                return 0;