Make "HTTPRequest::fetchUrlFull" dynamic

pull/8911/head
nupplaPhil 2020-03-04 22:19:59 +01:00 committed by Hypolite Petovan
parent 8793096c16
commit 3b4cf87c95
4 changed files with 6 additions and 6 deletions

View File

@ -126,7 +126,7 @@ function pubsubhubbub_init(App $a) {
$hub_callback = rtrim($hub_callback, ' ?&#');
$separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
$fetchResult = HTTPRequest::fetchUrlFull($hub_callback . $separator . $params);
$fetchResult = DI::httpRequest()->fetchUrlFull($hub_callback . $separator . $params);
$body = $fetchResult->getBody();
$ret = $fetchResult->getReturnCode();

View File

@ -548,11 +548,11 @@ class Installer
$help = "";
$error_msg = "";
if (function_exists('curl_init')) {
$fetchResult = HTTPRequest::fetchUrlFull($baseurl . "/install/testrewrite");
$fetchResult = DI::httpRequest()->fetchUrlFull($baseurl . "/install/testrewrite");
$url = Strings::normaliseLink($baseurl . "/install/testrewrite");
if ($fetchResult->getReturnCode() != 204) {
$fetchResult = HTTPRequest::fetchUrlFull($url);
$fetchResult = DI::httpRequest()->fetchUrlFull($url);
}
if ($fetchResult->getReturnCode() != 204) {

View File

@ -365,9 +365,9 @@ class HTTPRequest
* @return CurlResult With all relevant information, 'body' contains the actual fetched content.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function fetchUrlFull(string $url, bool $binary = false, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
public function fetchUrlFull(string $url, bool $binary = false, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
{
return self::curl(
return $this->curl(
$url,
$binary,
[

View File

@ -103,7 +103,7 @@ class PortableContact
Logger::log('load: ' . $url, Logger::DEBUG);
$fetchresult = HTTPRequest::fetchUrlFull($url);
$fetchresult = DI::httpRequest()->fetchUrlFull($url);
$s = $fetchresult->getBody();
Logger::log('load: returns ' . $s, Logger::DATA);