]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/GlobalCommunitySilence.php
Merge branch '2019.01-rc' into bug/6334-escape-get-app
[friendica.git] / src / Core / Console / GlobalCommunitySilence.php
index d583a747a7b911a11358636129f95906cb38164d..b0281241e360c003692ef92efeef0933cf543838 100644 (file)
@@ -5,10 +5,9 @@ namespace Friendica\Core\Console;
 use Friendica\Core\Protocol;
 use Friendica\Database\DBA;
 use Friendica\Network\Probe;
+use Friendica\Util\Strings;
 use RuntimeException;
 
-require_once 'include/text.php';
-
 /**
  * @brief tool to silence accounts on the global community page
  *
@@ -19,8 +18,8 @@ require_once 'include/text.php';
  *
  * License: AGPLv3 or later, same as Friendica
  *
- * @author Tobias Diekershoff
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Tobias Diekershoff <tobias.diekershoff@gmx.net>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
  */
 class GlobalCommunitySilence extends \Asika\SimpleConsole\Console
 {
@@ -48,7 +47,7 @@ HELP;
 
        protected function doExecute()
        {
-               $a = get_app();
+               $a = \get_app();
 
                if ($this->getOption('v')) {
                        $this->out('Class: ' . __CLASS__);
@@ -65,7 +64,7 @@ HELP;
                        throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
                }
 
-               if ($a->isInstallMode()) {
+               if ($a->getMode()->isInstall()) {
                        throw new RuntimeException('Database isn\'t ready or populated yet');
                }
 
@@ -79,9 +78,9 @@ HELP;
                        throw new RuntimeException('This account seems not to exist.');
                }
 
-               $nurl = normalise_link($net['url']);
+               $nurl = Strings::normaliseLink($net['url']);
                $contact = DBA::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
-               if (DBA::is_result($contact)) {
+               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 {