mirror of
https://github.com/friendica/friendica
synced 2025-04-26 15:50:10 +00:00
Make "HTTPRequest::fetchUrl" dynamic
This commit is contained in:
parent
3b4cf87c95
commit
1aa07f87a4
20 changed files with 26 additions and 46 deletions
|
@ -21,8 +21,6 @@
|
|||
|
||||
namespace Friendica\Core;
|
||||
|
||||
use Friendica\Network\HTTPRequest;
|
||||
|
||||
/**
|
||||
* Manage compatibility with federated networks
|
||||
*/
|
||||
|
@ -123,7 +121,7 @@ class Protocol
|
|||
if (preg_match('=https?://(.*)/user/(.*)=ism', $profile_url, $matches)) {
|
||||
$statusnet_host = $matches[1];
|
||||
$statusnet_user = $matches[2];
|
||||
$UserData = HTTPRequest::fetchUrl('http://' . $statusnet_host . '/api/users/show.json?user_id=' . $statusnet_user);
|
||||
$UserData = DI::httpRequest()->fetchUrl('http://' . $statusnet_host . '/api/users/show.json?user_id=' . $statusnet_user);
|
||||
$user = json_decode($UserData);
|
||||
if ($user) {
|
||||
$matches[2] = $user->screen_name;
|
||||
|
|
|
@ -26,7 +26,6 @@ use Friendica\DI;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GContact;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Network\HTTPRequest;
|
||||
use Friendica\Object\Search\ContactResult;
|
||||
use Friendica\Object\Search\ResultList;
|
||||
use Friendica\Util\Network;
|
||||
|
@ -124,7 +123,7 @@ class Search
|
|||
$searchUrl .= '&page=' . $page;
|
||||
}
|
||||
|
||||
$resultJson = HTTPRequest::fetchUrl($searchUrl, false, 0, 'application/json');
|
||||
$resultJson = DI::httpRequest()->fetchUrl($searchUrl, false, 0, 'application/json');
|
||||
|
||||
$results = json_decode($resultJson, true);
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ use Friendica\Core;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Process;
|
||||
use Friendica\Network\HTTPRequest;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
/**
|
||||
|
@ -997,7 +996,7 @@ class Worker
|
|||
}
|
||||
|
||||
$url = DI::baseUrl() . '/worker';
|
||||
HTTPRequest::fetchUrl($url, false, 1);
|
||||
DI::httpRequest()->fetchUrl($url, false, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue