Merge pull request #1006 from MrPetovan/task/curl_DI
Introduce "HTTPRequest" class
This commit is contained in:
commit
2c69a9c359
18 changed files with 34 additions and 49 deletions
|
@ -15,7 +15,6 @@ use Friendica\Core\Hook;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Proxy as ProxyUtils;
|
||||
|
||||
function curweather_install()
|
||||
|
@ -49,7 +48,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
|
|||
}
|
||||
|
||||
try {
|
||||
$res = new SimpleXMLElement(Network::fetchUrl($url));
|
||||
$res = new SimpleXMLElement(DI::httpRequest()->fetch($url));
|
||||
} catch (Exception $e) {
|
||||
if (empty($_SESSION['curweather_notice_shown'])) {
|
||||
notice(DI::l10n()->t('Error fetching weather data. Error was: ' . $e->getMessage()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue