From 8f49ff2054bdef193bca10fb757007d95bff2d4d Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 19 Jan 2020 16:35:10 +0100 Subject: [PATCH] Fix missing Cache namespace --- curweather/curweather.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/curweather/curweather.php b/curweather/curweather.php index 2df31b0b..d3e002dd 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -10,6 +10,7 @@ */ use Friendica\App; +use Friendica\Core\Cache\Duration; use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Renderer; @@ -36,7 +37,7 @@ function curweather_uninstall() function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cachetime = 0) { $url = "http://api.openweathermap.org/data/2.5/weather?q=" . $loc . "&appid=" . $appid . "&lang=" . $lang . "&units=" . $units . "&mode=xml"; - $cached = Cache::get('curweather'.md5($url)); + $cached = DI::cache()->get('curweather'.md5($url)); $now = new DateTime(); if (!is_null($cached)) { @@ -90,7 +91,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti ]; DI::pConfig()->set(local_user(), 'curweather', 'last', $now->getTimestamp()); - Cache::set('curweather'.md5($url), serialize($r), Cache::HOUR); + DI::cache()->set('curweather'.md5($url), serialize($r), Duration::HOUR); return $r; }