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;
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;
125 $server_available =
true;
128 if (!$server_available) {
129 return 'No Memcached-Server available';
131 return parent::getInstallationFailureReason();
static where($where, $operator=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(string $service_id, string $component)
ilGlobalCacheService constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInstallationFailureReason()
isValid(string $key)
Checks whether the cache key is valid or not.
flush(bool $complete=false)
static Memcached $memcache_object
unserialize($serialized_value)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc