]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/GServer.php
Merge pull request #9405 from nupplaphil/task/psr7_remove_binary
[friendica.git] / src / Model / GServer.php
index aa598a729a0756a6950bf6e0210048983c8fd1f9..009816d8186c7f82f1b71a4b007de7f99fa39f5c 100644 (file)
@@ -311,7 +311,7 @@ class GServer
 
                // When a nodeinfo is present, we don't need to dig further
                $xrd_timeout = DI::config()->get('system', 'xrd_timeout');
-               $curlResult = DI::httpRequest()->get($url . '/.well-known/nodeinfo', false, ['timeout' => $xrd_timeout]);
+               $curlResult = DI::httpRequest()->get($url . '/.well-known/nodeinfo', ['timeout' => $xrd_timeout]);
                if ($curlResult->isTimeout()) {
                        self::setFailure($url);
                        return false;
@@ -344,7 +344,7 @@ class GServer
                                        $basedata = ['detection-method' => self::DETECT_MANUAL];
                                }
 
-                               $curlResult = DI::httpRequest()->get($baseurl, false, ['timeout' => $xrd_timeout]);
+                               $curlResult = DI::httpRequest()->get($baseurl, ['timeout' => $xrd_timeout]);
                                if ($curlResult->isSuccess()) {
                                        $basedata = self::analyseRootHeader($curlResult, $basedata);
                                        $basedata = self::analyseRootBody($curlResult, $basedata, $baseurl);
@@ -361,7 +361,7 @@ class GServer
                                        // When the base path doesn't seem to contain a social network we try the complete path.
                                        // Most detectable system have to be installed in the root directory.
                                        // We checked the base to avoid false positives.
-                                       $curlResult = DI::httpRequest()->get($url, false, ['timeout' => $xrd_timeout]);
+                                       $curlResult = DI::httpRequest()->get($url, ['timeout' => $xrd_timeout]);
                                        if ($curlResult->isSuccess()) {
                                                $urldata = self::analyseRootHeader($curlResult, $serverdata);
                                                $urldata = self::analyseRootBody($curlResult, $urldata, $url);
@@ -913,7 +913,7 @@ class GServer
        private static function validHostMeta(string $url)
        {
                $xrd_timeout = DI::config()->get('system', 'xrd_timeout');
-               $curlResult = DI::httpRequest()->get($url . '/.well-known/host-meta', false, ['timeout' => $xrd_timeout]);
+               $curlResult = DI::httpRequest()->get($url . '/.well-known/host-meta', ['timeout' => $xrd_timeout]);
                if (!$curlResult->isSuccess()) {
                        return false;
                }
@@ -1639,7 +1639,7 @@ class GServer
                if (!empty($accesstoken)) {
                        $api = 'https://instances.social/api/1.0/instances/list?count=0';
                        $header = ['Authorization: Bearer '.$accesstoken];
-                       $curlResult = DI::httpRequest()->get($api, false, ['headers' => $header]);
+                       $curlResult = DI::httpRequest()->get($api, ['headers' => $header]);
 
                        if ($curlResult->isSuccess()) {
                                $servers = json_decode($curlResult->getBody(), true);
@@ -1653,18 +1653,4 @@ class GServer
 
                DI::config()->set('poco', 'last_federation_discovery', time());
        }
-
-       /**
-        * Returns a list of 1,000 active servers order by the last contact
-        *
-        * @return array List of server urls
-        * @throws Exception
-        */
-       public static function getActive()
-       {
-               $result = DBA::p("SELECT `url`, `site_name` AS `displayName`, `network`, `platform`, `version` FROM `gserver`
-                       WHERE `network` IN (?, ?, ?, ?) AND NOT `failed` ORDER BY `last_contact` LIMIT ?",
-                       Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::ACTIVITYPUB, 1000);
-               return DBA::toArray($result);
-       }
 }