Nodeinfo data has moved to key values

This commit is contained in:
Michael 2023-01-18 05:04:37 +00:00
parent 4b73335def
commit 73e163100c
6 changed files with 45 additions and 26 deletions

View file

@ -25,7 +25,6 @@ use Friendica\BaseDataTransferObject;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Protocol;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
/**
@ -45,9 +44,9 @@ class Stats extends BaseDataTransferObject
public function __construct(IManageConfigValues $config, Database $database)
{
if (!empty($config->get('system', 'nodeinfo'))) {
$this->user_count = intval($config->get('nodeinfo', 'total_users'));
$this->status_count = $config->get('nodeinfo', 'local_posts') + $config->get('nodeinfo', 'local_comments');
$this->domain_count = $database->count('gserver', ["`network` in (?, ?) AND NOT `failed`", Protocol::DFRN, Protocol::ACTIVITYPUB]);
$this->user_count = intval(DI::keyValue()->get('nodeinfo_total_users'));
$this->status_count = DI::keyValue()->get('nodeinfo_local_posts') + DI::keyValue()->get('nodeinfo_local_comments');
$this->domain_count = $database->count('gserver', ["`network` in (?, ?) AND NOT `failed` AND NOT `blocked`", Protocol::DFRN, Protocol::ACTIVITYPUB]);
}
}
}