25 $this->cache = $cache;
34 $this->cache->clear();
48 return $this->cache->save($type,
$data, $expire_after);
66 $cached_data = $this->cache->load($type);
67 if (isset($cached_data)) {
78 public function delete(
string $type) {
79 return $this->cache->delete(
$type);
88 return (
bool) $this->config->system_cache_enabled;
100 $this->config->save(
'system_cache_enabled', 1);
113 $this->config->save(
'system_cache_enabled', 0);
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.
$config
Advanced site settings, debugging section.
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.
__construct(BaseCache $cache, protected Config $config)
Constructor.
disable()
Disables the system disk cache.
trait Cacheable
Utility trait for injecting cache.