mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 09:54:27 +02:00
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
|
@ -9,13 +9,12 @@
|
|||
*
|
||||
*/
|
||||
|
||||
use Friendica\DI;
|
||||
use Friendica\Core\Cache\Duration;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\ConfigFileLoader;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
const OSM_TMS = 'https://www.openstreetmap.org';
|
||||
|
@ -132,7 +131,7 @@ function openstreetmap_get_coordinates($a, &$b)
|
|||
$j = DI::cache()->get($cachekey);
|
||||
|
||||
if (is_null($j)) {
|
||||
$curlResult = Network::curl($nomserver . $args);
|
||||
$curlResult = DI::httpRequest()->get($nomserver . $args);
|
||||
if ($curlResult->isSuccess()) {
|
||||
$j = json_decode($curlResult->getBody(), true);
|
||||
DI::cache()->set($cachekey, $j, Duration::MONTH);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue