Rename DI::httpRequest() into DI::httpClient()

This commit is contained in:
Philipp 2021-08-25 21:54:54 +02:00
parent 505100bdd7
commit 13a91e63aa
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
38 changed files with 94 additions and 94 deletions

View file

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

View file

@ -122,7 +122,7 @@ class Protocol
if (preg_match('=https?://(.*)/user/(.*)=ism', $profile_url, $matches)) {
$statusnet_host = $matches[1];
$statusnet_user = $matches[2];
$UserData = DI::httpRequest()->fetch('http://' . $statusnet_host . '/api/users/show.json?user_id=' . $statusnet_user);
$UserData = DI::httpClient()->fetch('http://' . $statusnet_host . '/api/users/show.json?user_id=' . $statusnet_user);
$user = json_decode($UserData);
if ($user) {
$matches[2] = $user->screen_name;

View file

@ -122,7 +122,7 @@ class Search
$searchUrl .= '&page=' . $page;
}
$resultJson = DI::httpRequest()->fetch($searchUrl, 0, 'application/json');
$resultJson = DI::httpClient()->fetch($searchUrl, 0, 'application/json');
$results = json_decode($resultJson, true);
@ -228,7 +228,7 @@ class Search
$return = Contact::searchByName($search, $mode);
} else {
$p = $page > 1 ? 'p=' . $page : '';
$curlResult = DI::httpRequest()->get(self::getGlobalDirectory() . '/search/people?' . $p . '&q=' . urlencode($search), [HTTPClientOptions::ACCEPT_CONTENT => ['application/json']]);
$curlResult = DI::httpClient()->get(self::getGlobalDirectory() . '/search/people?' . $p . '&q=' . urlencode($search), [HTTPClientOptions::ACCEPT_CONTENT => ['application/json']]);
if ($curlResult->isSuccess()) {
$searchResult = json_decode($curlResult->getBody(), true);
if (!empty($searchResult['profiles'])) {