mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 06:43:40 +00:00
[openstreetmap] Fix references to Cache
This commit is contained in:
parent
6121ad71d3
commit
d0a63610bd
1 changed files with 3 additions and 3 deletions
|
@ -10,7 +10,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Core\Cache;
|
use Friendica\Core\Cache\Cache;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
@ -131,13 +131,13 @@ function openstreetmap_get_coordinates($a, &$b)
|
||||||
$args = '?q=' . urlencode($b['location']) . '&format=json';
|
$args = '?q=' . urlencode($b['location']) . '&format=json';
|
||||||
|
|
||||||
$cachekey = "openstreetmap:" . $b['location'];
|
$cachekey = "openstreetmap:" . $b['location'];
|
||||||
$j = Cache::get($cachekey);
|
$j = DI::cache()->get($cachekey);
|
||||||
|
|
||||||
if (is_null($j)) {
|
if (is_null($j)) {
|
||||||
$curlResult = Network::curl($nomserver . $args);
|
$curlResult = Network::curl($nomserver . $args);
|
||||||
if ($curlResult->isSuccess()) {
|
if ($curlResult->isSuccess()) {
|
||||||
$j = json_decode($curlResult->getBody(), true);
|
$j = json_decode($curlResult->getBody(), true);
|
||||||
Cache::set($cachekey, $j, Cache::MONTH);
|
DI::cache()->set($cachekey, $j, Cache::MONTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue