X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnodeinfo.php;h=ed0166838fdc3df1733d15328234051a80a8a23e;hb=7f143c3159615b4a10539447bcf250a5fca793a5;hp=1b9dce5f5549b2c21b991619bbcf5f05c843c5b2;hpb=80ac7da01d3dedf92e3673b4b97d37287bb16488;p=friendica.git diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php index 1b9dce5f55..ed0166838f 100644 --- a/mod/nodeinfo.php +++ b/mod/nodeinfo.php @@ -7,8 +7,9 @@ use Friendica\App; use Friendica\Core\Addon; -use Friendica\Core\System; use Friendica\Core\Config; +use Friendica\Core\System; +use Friendica\Database\DBA; use Friendica\Util\Network; require_once 'include/dba.php'; @@ -61,9 +62,9 @@ function nodeinfo_init(App $a) { $nodeinfo['usage'] = []; - $nodeinfo['openRegistrations'] = ($a->config['register_policy'] != 0); + $nodeinfo['openRegistrations'] = intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED; - $nodeinfo['metadata'] = ['nodeName' => $a->config['sitename']]; + $nodeinfo['metadata'] = ['nodeName' => Config::get('config', 'sitename')]; if (Config::get('system', 'nodeinfo')) { @@ -73,21 +74,12 @@ function nodeinfo_init(App $a) { $nodeinfo['usage']['localPosts'] = (int)Config::get('nodeinfo', 'local_posts'); $nodeinfo['usage']['localComments'] = (int)Config::get('nodeinfo', 'local_comments'); - if (Addon::isEnabled('appnet')) { - $nodeinfo['services']['inbound'][] = 'appnet'; - } - if (Addon::isEnabled('appnet') || Addon::isEnabled('buffer')) { - $nodeinfo['services']['outbound'][] = 'appnet'; - } if (Addon::isEnabled('blogger')) { $nodeinfo['services']['outbound'][] = 'blogger'; } if (Addon::isEnabled('dwpost')) { $nodeinfo['services']['outbound'][] = 'dreamwidth'; } - if (Addon::isEnabled('fbpost') || Addon::isEnabled('buffer')) { - $nodeinfo['services']['outbound'][] = 'facebook'; - } if (Addon::isEnabled('statusnet')) { $nodeinfo['services']['inbound'][] = 'gnusocial'; $nodeinfo['services']['outbound'][] = 'gnusocial'; @@ -214,16 +206,16 @@ function nodeinfo_cron() { logger('total_users: ' . $total_users . '/' . $active_users_halfyear. '/' . $active_users_monthly, LOGGER_DEBUG); } - $local_posts = dba::count('thread', ["`wall` AND NOT `deleted` AND `uid` != 0"]); + $local_posts = DBA::count('thread', ["`wall` AND NOT `deleted` AND `uid` != 0"]); Config::set('nodeinfo', 'local_posts', $local_posts); logger('local_posts: ' . $local_posts, LOGGER_DEBUG); - $local_comments = dba::count('item', ["`origin` AND `id` != `parent` AND NOT `deleted` AND `uid` != 0"]); + $local_comments = DBA::count('item', ["`origin` AND `id` != `parent` AND NOT `deleted` AND `uid` != 0"]); Config::set('nodeinfo', 'local_comments', $local_comments); logger('local_comments: ' . $local_comments, LOGGER_DEBUG); // Now trying to register - $url = 'http://the-federation.info/register/'.$a->get_hostname(); + $url = 'http://the-federation.info/register/'.$a->getHostName(); logger('registering url: '.$url, LOGGER_DEBUG); $ret = Network::fetchUrl($url); logger('registering answer: '.$ret, LOGGER_DEBUG);