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

This commit is contained in:
Philipp 2021-08-25 21:54:54 +02:00
parent 9c266e59cf
commit adada10eb6
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
19 changed files with 25 additions and 25 deletions

View file

@ -136,7 +136,7 @@ function statusnet_settings_post(App $a, $post)
foreach ($globalsn as $asn) {
if ($asn['apiurl'] == $_POST['statusnet-preconf-apiurl']) {
$apibase = $asn['apiurl'];
$c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml');
$c = DI::httpClient()->fetch($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']);
DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']);
@ -154,7 +154,7 @@ function statusnet_settings_post(App $a, $post)
// we'll check the API Version for that, if we don't get one we'll try to fix the path but will
// resign quickly after this one try to fix the path ;-)
$apibase = $_POST['statusnet-baseapi'];
$c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml');
$c = DI::httpClient()->fetch($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
// ok the API path is correct, let's save the settings
DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
@ -164,7 +164,7 @@ function statusnet_settings_post(App $a, $post)
} else {
// the API path is not correct, maybe missing trailing / ?
$apibase = $apibase . '/';
$c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml');
$c = DI::httpClient()->fetch($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
// ok the API path is now correct, let's save the settings
DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
@ -597,7 +597,7 @@ function statusnet_post_hook(App $a, &$b)
}
if ($image != "") {
$img_str = DI::httpRequest()->fetch($image);
$img_str = DI::httpClient()->fetch($image);
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);
$postdata = ["status" => $msg, "media[]" => $tempfile];
@ -1426,7 +1426,7 @@ function statusnet_convertmsg(App $a, $body)
Logger::log("statusnet_convertmsg: expanding url " . $match[1], Logger::DEBUG);
$expanded_url = DI::httpRequest()->finalUrl($match[1]);
$expanded_url = DI::httpClient()->finalUrl($match[1]);
Logger::log("statusnet_convertmsg: fetching data for " . $expanded_url, Logger::DEBUG);
@ -1450,7 +1450,7 @@ function statusnet_convertmsg(App $a, $body)
} elseif ($oembed_data->type != "link") {
$body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body);
} else {
$img_str = DI::httpRequest()->fetch($expanded_url, 4);
$img_str = DI::httpClient()->fetch($expanded_url, 4);
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);