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
*
*
* 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
{
protected function doExecute()
{
- $a = get_app();
+ $a = \get_app();
if ($this->getOption('v')) {
$this->out('Class: ' . __CLASS__);
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');
}
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 {