39 public function __construct(
string $service_id,
string $component)
43 self::$active[static::class] = $this->
getActive();
47 abstract protected function getActive(): bool;
55 abstract public function unserialize($serialized_value);
60 abstract public function get(
string $key);
65 abstract public function set(
string $key, $serialized_value,
int $ttl = null):
bool;
71 abstract public function serialize($value);
95 return self::$active[static::class];
100 return self::$installable[static::class];
116 return 'Not installed';
119 return 'Not enough Cache-Memory, set to at least ' . $this->
getMinMemory() .
'M';
122 return 'Unknown reason';
139 if (preg_match(
'#(\d*)([M|K])#uim', $memory_limit, $matches)) {
140 if ($matches[2] ===
'M') {
141 $memory_limit = $matches[1] * 1024 * 1024;
142 } elseif ($matches[2] ===
'K') {
143 $memory_limit = $matches[1] * 1024;
146 $memory_limit *= 1024 * 1024;
149 return ($memory_limit >= $this->
getMinMemory() * 1024 * 1024);
152 abstract public function exists(
string $key): bool;
154 abstract public function delete(
string $key):
bool;
156 abstract public function flush(
bool $complete =
false): bool;
170 $this->valid_keys[
$key] =
true;
175 return isset($this->valid_keys[$key]);
setServiceType(int $service_type)
isValid(string $key)
Checks whether the cache key is valid or not.
static array $installable
flush(bool $complete=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValid(string $key)
Declare a key as valid.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInstallationFailureReason()
setServiceId(string $service_id)
__construct(string $service_id, string $component)
ilGlobalCacheService constructor.
unserialize($serialized_value)
setComponent(string $component)