mirror of
https://github.com/friendica/friendica
synced 2025-04-26 03:10:13 +00:00
Move post/curl/fetchUrl/fetchUrlFull to own class "Network\HTTPRequest"
This commit is contained in:
parent
2889d59b83
commit
5344efef71
43 changed files with 528 additions and 485 deletions
|
@ -28,13 +28,13 @@ use Friendica\DI;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Network\HTTPRequest;
|
||||
use Friendica\Protocol\Activity;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Protocol\Email;
|
||||
use Friendica\Protocol\Feed;
|
||||
use Friendica\Protocol\PortableContact;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Strings;
|
||||
use Friendica\Util\XML;
|
||||
|
||||
|
@ -291,7 +291,7 @@ class OnePoll
|
|||
. '&type=data&last_update=' . $last_update
|
||||
. '&perm=' . $perm;
|
||||
|
||||
$curlResult = Network::curl($url);
|
||||
$curlResult = HTTPRequest::curl($url);
|
||||
|
||||
if (!$curlResult->isSuccess() && ($curlResult->getErrorNumber() == CURLE_OPERATION_TIMEDOUT)) {
|
||||
// set the last-update so we don't keep polling
|
||||
|
@ -405,7 +405,7 @@ class OnePoll
|
|||
$postvars['dfrn_version'] = DFRN_PROTOCOL_VERSION;
|
||||
$postvars['perm'] = 'rw';
|
||||
|
||||
return Network::post($contact['poll'], $postvars)->getBody();
|
||||
return HTTPRequest::post($contact['poll'], $postvars)->getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -444,7 +444,7 @@ class OnePoll
|
|||
}
|
||||
|
||||
$cookiejar = tempnam(get_temppath(), 'cookiejar-onepoll-');
|
||||
$curlResult = Network::curl($contact['poll'], false, ['cookiejar' => $cookiejar]);
|
||||
$curlResult = HTTPRequest::curl($contact['poll'], false, ['cookiejar' => $cookiejar]);
|
||||
unlink($cookiejar);
|
||||
|
||||
if ($curlResult->isTimeout()) {
|
||||
|
@ -756,7 +756,7 @@ class OnePoll
|
|||
DBA::update('contact', ['hub-verify' => $verify_token], ['id' => $contact['id']]);
|
||||
}
|
||||
|
||||
$postResult = Network::post($url, $params);
|
||||
$postResult = HTTPRequest::post($url, $params);
|
||||
|
||||
Logger::log('subscribe_to_hub: returns: ' . $postResult->getReturnCode(), Logger::DEBUG);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue