}
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')]);
}
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')]);
$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;
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)
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;
$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;