1
0
Fork 0

Move post/curl/fetchUrl/fetchUrlFull to own class "Network\HTTPRequest"

This commit is contained in:
nupplaPhil 2020-03-04 22:07:05 +01:00 committed by Hypolite Petovan
commit 5344efef71
43 changed files with 528 additions and 485 deletions

View file

@ -30,8 +30,8 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\GContact;
use Friendica\Model\GServer;
use Friendica\Network\HTTPRequest;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\Strings;
/**
@ -103,7 +103,7 @@ class PortableContact
Logger::log('load: ' . $url, Logger::DEBUG);
$fetchresult = Network::fetchUrlFull($url);
$fetchresult = HTTPRequest::fetchUrlFull($url);
$s = $fetchresult->getBody();
Logger::log('load: returns ' . $s, Logger::DATA);
@ -251,7 +251,7 @@ class PortableContact
*/
private static function fetchServerlist($poco)
{
$curlResult = Network::curl($poco . "/@server");
$curlResult = HTTPRequest::curl($poco . "/@server");
if (!$curlResult->isSuccess()) {
return;
@ -291,7 +291,7 @@ class PortableContact
Logger::info("Fetch all users from the server " . $server["url"]);
$curlResult = Network::curl($url);
$curlResult = HTTPRequest::curl($url);
if ($curlResult->isSuccess() && !empty($curlResult->getBody())) {
$data = json_decode($curlResult->getBody(), true);
@ -314,7 +314,7 @@ class PortableContact
$success = false;
$curlResult = Network::curl($url);
$curlResult = HTTPRequest::curl($url);
if ($curlResult->isSuccess() && !empty($curlResult->getBody())) {
Logger::info("Fetch all global contacts from the server " . $server["nurl"]);
@ -372,7 +372,7 @@ class PortableContact
// Fetch all contacts from a given user from the other server
$url = $server['poco'] . '/' . $username . '/?fields=displayName,urls,photos,updated,network,aboutMe,currentLocation,tags,contactType,generation';
$curlResult = Network::curl($url);
$curlResult = HTTPRequest::curl($url);
if ($curlResult->isSuccess()) {
$data = json_decode($curlResult->getBody(), true);