<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\DI;
+use stdClass;
/**
* Standardized way of exposing metadata about a server running one of the distributed social networks.
/**
* Return the supported services
*
- * @return array with supported services
+ * @return Object with supported services
*/
private static function getUsage()
{
$config = DI::config();
- $usage = [];
+ $usage = new stdClass();
if (!empty($config->get('system', 'nodeinfo'))) {
- $usage['users'] = [
+ $usage->users = [
'total' => intval($config->get('nodeinfo', 'total_users')),
'activeHalfyear' => intval($config->get('nodeinfo', 'active_users_halfyear')),
'activeMonth' => intval($config->get('nodeinfo', 'active_users_monthly'))
];
- $usage['localPosts'] = intval($config->get('nodeinfo', 'local_posts'));
- $usage['localComments'] = intval($config->get('nodeinfo', 'local_comments'));
+ $usage->localPosts = intval($config->get('nodeinfo', 'local_posts'));
+ $usage->localComments = intval($config->get('nodeinfo', 'local_comments'));
}
return $usage;
$nodeinfo = [
'version' => '1.0',
'software' => [
- 'name' => 'Friendica',
+ 'name' => 'friendica',
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
],
'protocols' => [
'inbound' => [
- 'friendica', 'activitypub'
+ 'friendica'
],
'outbound' => [
- 'friendica', 'activitypub'
+ 'friendica'
],
],
'services' => [],
$nodeinfo = [
'version' => '2.0',
'software' => [
- 'name' => 'Friendica',
+ 'name' => 'friendica',
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
],
'protocols' => ['dfrn', 'activitypub'],