}
$cachekey = "ping_init:".local_user();
- $ev = Cache::get($cachekey);
+ $ev = DI::cache()->get($cachekey);
if (is_null($ev)) {
$ev = q(
"SELECT type, start, adjust FROM `event`
if (isset($contact['account-type'])) {
$contact['contact-type'] = $contact['account-type'];
}
- $about = Cache::get("about:" . $contact['updated'] . ":" . $contact['nurl']);
+ $about = DI::cache()->get("about:" . $contact['updated'] . ":" . $contact['nurl']);
if (is_null($about)) {
$about = BBCode::convert($contact['about'], false);
DI::cache()->set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about);
if (DBA::isResult($oembed_record)) {
$json_string = $oembed_record['content'];
} else {
- $json_string = Cache::get($cache_key);
+ $json_string = DI::cache()->get($cache_key);
}
// These media files should now be caught in bbcode.php
private static function removePictureLinksCallback($match)
{
$cache_key = 'remove:' . $match[1];
- $text = Cache::get($cache_key);
+ $text = DI::cache()->get($cache_key);
if (is_null($text)) {
$a = DI::app();
}
$cache_key = 'clean:' . $match[1];
- $text = Cache::get($cache_key);
+ $text = DI::cache()->get($cache_key);
if (!is_null($text)) {
return $text;
}
const MINUTE = CacheClass::MINUTE;
/** @deprecated Use CacheClass::INFINITE */
const INFINITE = CacheClass::INFINITE;
-
- /**
- * @brief Fetch cached data according to the key
- *
- * @param string $key The key to the cached data
- *
- * @return mixed Cached $value or "null" if not found
- * @throws \Exception
- */
- public static function get($key)
- {
- return DI::cache()->get($key);
- }
}
$sql_extra = Security::getPermissionsSQLByUserId($uid);
$key = "photo_albums:".$uid.":".local_user().":".remote_user();
- $albums = Cache::get($key);
+ $albums = DI::cache()->get($key);
if (is_null($albums) || $update) {
if (!Config::get("system", "no_count", false)) {
/// @todo This query needs to be renewed. It is really slow
$bd_short = L10n::t('F d');
$cachekey = 'get_birthdays:' . local_user();
- $r = Cache::get($cachekey);
+ $r = DI::cache()->get($cachekey);
if (is_null($r)) {
$s = DBA::p(
"SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
// Avoid endless loops
$cachekey = 'zrlInit:' . $my_url;
- if (Cache::get($cachekey)) {
+ if (DI::cache()->get($cachekey)) {
Logger::log('URL ' . $my_url . ' already tried to authenticate.', Logger::DEBUG);
return;
} else {
*/
public static function getGlobalTrendingHashtags(int $period, $limit = 10)
{
- $tags = Cache::get('global_trending_tags');
+ $tags = DI::cache()->get('global_trending_tags');
if (!$tags) {
$tagsStmt = DBA::p("SELECT t.`term`, COUNT(*) AS `score`
*/
public static function getLocalTrendingHashtags(int $period, $limit = 10)
{
- $tags = Cache::get('local_trending_tags');
+ $tags = DI::cache()->get('local_trending_tags');
if (!$tags) {
$tagsStmt = DBA::p("SELECT t.`term`, COUNT(*) AS `score`
$crawl_permit_period = 10;
$remote = $_SERVER['REMOTE_ADDR'];
- $result = Cache::get('remote_search:' . $remote);
+ $result = DI::cache()->get('remote_search:' . $remote);
if (!is_null($result)) {
$resultdata = json_decode($result);
if (($resultdata->time > (time() - $crawl_permit_period)) && ($resultdata->accesses > $free_crawls)) {
public static function uri($uri, $network = '', $uid = -1, $cache = true)
{
if ($cache) {
- $result = Cache::get('Probe::uri:' . $network . ':' . $uri);
+ $result = DI::cache()->get('Probe::uri:' . $network . ':' . $uri);
if (!is_null($result)) {
return $result;
}
$cachekey = 'APDelivery:createActivity:' . $item_id;
if (!$force) {
- $data = Cache::get($cachekey);
+ $data = DI::cache()->get($cachekey);
if (!is_null($data)) {
return $data;
}
$cachekey = "diaspora:sendParticipation:".$item['guid'];
- $result = Cache::get($cachekey);
+ $result = DI::cache()->get($cachekey);
if (!is_null($result)) {
return;
}
{
$cachekey = "diaspora:buildStatus:".$item['guid'];
- $result = Cache::get($cachekey);
+ $result = DI::cache()->get($cachekey);
if (!is_null($result)) {
return $result;
}
{
$cachekey = "diaspora:constructComment:".$item['guid'];
- $result = Cache::get($cachekey);
+ $result = DI::cache()->get($cachekey);
if (!is_null($result)) {
return $result;
}
// Don't cache when the last item was posted less then 15 minutes ago (Cache duration)
if ((time() - strtotime($owner['last-item'])) < 15*60) {
- $result = Cache::get($cachekey);
+ $result = DI::cache()->get($cachekey);
if (!$nocache && !is_null($result)) {
Logger::log('Feed duration: ' . number_format(microtime(true) - $stamp, 3) . ' - ' . $owner_nick . ' - ' . $filter . ' - ' . $previous_created . ' (cached)', Logger::DEBUG);
$last_update = $result['last_update'];
return $data;
}
- $data = Cache::get($url);
+ $data = DI::cache()->get($url);
if (empty($data) || !is_array($data)) {
$data = self::getInfoFromURL($url);
exit();
}
- $result = Cache::get('documentLoader:' . $url);
+ $result = DI::cache()->get('documentLoader:' . $url);
if (!is_null($result)) {
return $result;
}
return;
}
- $data = Cache::get('SearchDirectory:' . $search);
+ $data = DI::cache()->get('SearchDirectory:' . $search);
if (!is_null($data)) {
// Only search for the same item every 24 hours
if (time() < $data + (60 * 60 * 24)) {