]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/NodeInfo.php
Update log string in Module\Contact\Poke
[friendica.git] / src / Module / NodeInfo.php
index a62687de1b58a30ea903a52647456779423bda18..87321489f3934d506cffbcb0b3f3f724917dee3b 100644 (file)
@@ -1,10 +1,30 @@
 <?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.
@@ -26,22 +46,22 @@ class NodeInfo extends BaseModule
        /**
         * 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;
@@ -117,15 +137,15 @@ class NodeInfo extends BaseModule
                $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'          => [],
@@ -180,7 +200,7 @@ class NodeInfo extends BaseModule
                $nodeinfo = [
                        'version'           => '2.0',
                        'software'          => [
-                               'name'    => 'Friendica',
+                               'name'    => 'friendica',
                                'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
                        ],
                        'protocols'         => ['dfrn', 'activitypub'],