mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +02:00
Merge pull request #8072 from nupplaphil/task/Cache_to_DI
Replace Core\Cache wrapper with DI::cache() method
This commit is contained in:
commit
36190d1e79
21 changed files with 60 additions and 168 deletions
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
namespace Friendica\Model;
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Cache\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
|
@ -540,7 +540,7 @@ class Photo
|
|||
$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
|
||||
|
@ -563,7 +563,7 @@ class Photo
|
|||
DBA::escape(L10n::t("Contact Photos"))
|
||||
);
|
||||
}
|
||||
Cache::set($key, $albums, Cache::DAY);
|
||||
DI::cache()->set($key, $albums, Cache::DAY);
|
||||
}
|
||||
return $albums;
|
||||
}
|
||||
|
@ -576,7 +576,7 @@ class Photo
|
|||
public static function clearAlbumCache($uid)
|
||||
{
|
||||
$key = "photo_albums:".$uid.":".local_user().":".remote_user();
|
||||
Cache::set($key, null, Cache::DAY);
|
||||
DI::cache()->set($key, null, Cache::DAY);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue