33 if (!(self::$memcache_object instanceof Memcached) && $this->
getInstallable()) {
37 $memcached =
new Memcached();
40 $memcached->resetServerList();
44 foreach ($list as $ilMemcacheServer) {
46 $ilMemcacheServer->getHost(),
47 $ilMemcacheServer->getPort(),
48 $ilMemcacheServer->getWeight(),
51 $memcached->addServers($servers);
54 self::$memcache_object = $memcached;
61 return self::$memcache_object;
69 public function set(
string $key, $serialized_value,
int $ttl = null):
bool 72 ->set($this->
returnKey($key), $serialized_value, (
int) $ttl);
78 public function get(
string $key)
83 public function delete(
string $key):
bool 88 public function flush(
bool $complete =
false): bool
98 if (!is_array($stats)) {
103 if ((
int) $server[
'pid'] > 1) {
116 return class_exists(
'Memcached');
122 $server_available =
false;
124 if ($server[
'pid'] > 0) {
125 $server_available =
true;
128 if (!$server_available) {
129 return 'No Memcached-Server available';
131 return parent::getInstallationFailureReason();
isValid(string $key)
Checks whether the cache key is valid or not.
unserialize($serialized_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static where($where, $operator=null)
static Memcached $memcache_object
__construct(string $service_id, string $component)
ilGlobalCacheService constructor.
getInstallationFailureReason()
__construct(Container $dic, ilPlugin $plugin)
flush(bool $complete=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...