41 private readonly ?
ilIniFile $client_ini =
null,
44 if ($this->client_ini !==
null) {
52 return $this->config ?? $this->
toConfig();
67 $this->active = (bool) $client_ini->readVariable(
'cache',
'activate_global_cache');
68 $service_type = $client_ini->readVariable(
'cache',
'global_cache_service_type');
69 if (is_numeric($service_type)) {
70 $service_type = match ((
int) $service_type) {
71 0 => Config::PHPSTATIC,
72 2 => Config::MEMCACHED,
74 default => Config::PHPSTATIC,
77 $this->service = $service_type;
78 $read_group = $client_ini->readGroup(
'cache_activated_components');
81 array_map(
static function (
string $component):
string {
82 if ($component ===
'all') {
86 }, array_keys($read_group))
89 if ($this->db !==
null) {
91 foreach ($repo->getNodes() as $node) {
106 $client_ini->setVariable(
'cache',
'activate_global_cache', $this->active ?
'1' :
'0');
107 $client_ini->setVariable(
'cache',
'global_cache_service_type', $this->service);
108 $client_ini->removeGroup(
'cache_activated_components');
109 $client_ini->addGroup(
'cache_activated_components');
111 $client_ini->setVariable(
'cache_activated_components', $component,
'1');
115 if ($this->db !==
null) {
118 foreach ($this->nodes as $node) {
123 return $client_ini->
write();
138 $this->nodes[] = $node;
resetActivatedComponents()
addActivatedComponent(string $component)
__construct(private readonly ?ilIniFile $client_ini=null, private readonly ?ilDBInterface $db=null)
storeToIniFile(ilIniFile $client_ini)
addMemcachedNode(Node $node)
readFromIniFile(ilIniFile $client_ini)
setService(string $service)
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
write()
save ini-file-data to filesystem
A configuration for the setup.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilChatroomConfigFileHandler \ILIAS\Chatroom\classes.