30 $this->cache = $cache;
40 $this->cache->clear();
54 return $this->cache->save($type,
$data, $expire_after);
72 $cached_data = $this->cache->load($type);
73 if (isset($cached_data)) {
84 public function delete(
string $type) {
85 return $this->cache->delete(
$type);
94 return (
bool) $this->config->system_cache_enabled;
106 $this->config->save(
'system_cache_enabled', 1);
119 $this->config->save(
'system_cache_enabled', 0);
134 if (!$this->config->system_cache_loaded) {
save(string $type, $data, int $expire_after=null)
Saves a system cache.
reset()
Reset the system cache by deleting the caches.
isEnabled()
Is system cache enabled.
__construct(BaseCache $cache, Config $config)
Constructor.
if(!$entity instanceof\ElggUser) $data
load(string $type)
Retrieve the contents of a system cache.
enable()
Enables the system disk cache.
The Elgg cache base class.
_elgg_services()
Get the global service provider.
init()
Initializes the system cache.
disable()
Disables the system disk cache.
trait Cacheable
Utility trait for injecting cache.