]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/UpdateGServer.php
Merge pull request #9345 from annando/issue-9344
[friendica.git] / src / Worker / UpdateGServer.php
index 2e017422fee3236e106ca5ac98742700eaec3647..12f9572b92c95bbcb9da484fea258dc5c75a1132 100644 (file)
@@ -1,7 +1,24 @@
 <?php
 /**
- * @file src/Worker/UpdateGServer.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\Worker;
 
 use Friendica\Core\Logger;
@@ -10,8 +27,12 @@ use Friendica\Util\Strings;
 
 class UpdateGServer
 {
-       // Searches for the poco server list.
-       public static function execute($server_url)
+       /**
+        * Update the given server
+        * @param string  $server_url    Server URL
+        * @param boolean $only_nodeinfo Only use nodeinfo for server detection
+        */
+       public static function execute(string $server_url, bool $only_nodeinfo = false)
        {
                if (empty($server_url)) {
                        return;
@@ -22,7 +43,7 @@ class UpdateGServer
                        return;
                }
 
-               $ret = GServer::check($server_url);
+               $ret = GServer::check($server_url, '', false, $only_nodeinfo);
                Logger::info('Updated gserver', ['url' => $server_url, 'result' => $ret]);
        }
 }