From 191e298504f04088ca50e39010af97ece8a2f805 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 19 Jan 2020 16:29:54 +0100 Subject: [PATCH] add missing namespaces/fix wrong class-names --- advancedcontentfilter/advancedcontentfilter.php | 4 ++-- geocoordinates/geocoordinates.php | 4 ++-- mastodoncustomemojis/mastodoncustomemojis.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 586ff237..c9285813 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -372,7 +372,7 @@ function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, Res } if (!DBA::update('advancedcontentfilter_rules', $fields, ['id' => $args['id']])) { - throw new HTTPException\ServiceUnavaiableException(DBA::errorMessage()); + throw new HTTPException\ServiceUnavailableException(DBA::errorMessage()); } return json_encode(['message' => DI::l10n()->t('Rule successfully updated')]); @@ -393,7 +393,7 @@ function advancedcontentfilter_delete_rules_id(ServerRequestInterface $request, } if (!DBA::delete('advancedcontentfilter_rules', ['id' => $args['id']])) { - throw new HTTPException\ServiceUnavaiableException(DBA::errorMessage()); + throw new HTTPException\ServiceUnavailableException(DBA::errorMessage()); } return json_encode(['message' => DI::l10n()->t('Rule successfully deleted')]); diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index b91cdab1..49d72c69 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -48,7 +48,7 @@ function geocoordinates_resolve_item(&$item) $coords[0] = round($coords[0], 5); $coords[1] = round($coords[1], 5); - $result = Cache::get("geocoordinates:".$language.":".$coords[0]."-".$coords[1]); + $result = DI::cache()->get("geocoordinates:".$language.":".$coords[0]."-".$coords[1]); if (!is_null($result)) { $item["location"] = $result; return; @@ -78,7 +78,7 @@ function geocoordinates_resolve_item(&$item) Logger::log("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], Logger::DEBUG); if ($item["location"] != "") - Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]); + DI::cache()->set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]); } function geocoordinates_post_hook($a, &$item) diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index e1c20963..6d8a6816 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -11,7 +11,7 @@ use Friendica\App; use Friendica\Content\Smilies; -use Friendica\Core\Cache; +use Friendica\Core\Cache\Duration; use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Protocol; @@ -74,12 +74,12 @@ function mastodoncustomemojis_get_custom_emojis_for_author($author_link) $cache_key = 'mastodoncustomemojis:' . $api_base_url; - $return = Cache::get($cache_key); + $return = DI::cache()->get($cache_key); if (empty($return) || Config::get('system', 'ignore_cache')) { $return = mastodoncustomemojis_fetch_custom_emojis_for_url($api_base_url); - Cache::set($cache_key, $return, empty($return['texts']) ? Cache::QUARTER_HOUR : Cache::HOUR); + DI::cache()->set($cache_key, $return, empty($return['texts']) ? Duration::QUARTER_HOUR : Duration::HOUR); } return $return;