From: nupplaPhil Date: Sun, 19 Jan 2020 15:35:10 +0000 (+0100) Subject: Fix missing Cache namespace X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8f49ff2054bdef193bca10fb757007d95bff2d4d;p=friendica-addons.git Fix missing Cache namespace --- 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; }