19 declare(strict_types=1);
51 $settings = new \ilGlobalCacheSettingsAdapter();
54 !isset(
$data[
"components"]) ||
55 !
$data[
"components"] ||
56 !isset(
$data[
"service"]) ||
57 $data[
"service"] ===
"none" ||
59 $data[
"service"] ===
"memcached" &&
60 (!isset(
$data[
"memcached_nodes"]) || count(
$data[
"memcached_nodes"]) === 0)
63 $settings->setActive(
false);
65 $settings->setActive(
true);
66 switch (
$data[
"service"]) {
69 $settings->setService(\
ILIAS\Cache\Config::PHPSTATIC);
72 array_walk(
$data[
"memcached_nodes"],
function (array $node) use ($settings):
void {
73 $settings->addMemcachedNode($this->
convertNode($node));
75 $settings->setService(\
ILIAS\Cache\Config::MEMCACHED);
78 $settings->setService(\
ILIAS\Cache\Config::APCU);
81 throw new \InvalidArgumentException(
82 sprintf(
"Unknown caching service: '%s'",
$data[
"service"])
85 $settings->resetActivatedComponents();
86 if (
$data[
"components"] ===
"all") {
87 $settings->activateAll();
89 foreach (
$data[
"components"] as $cmp => $active) {
91 $settings->addActivatedComponent($cmp);
104 (
string) $node[
"host"],
106 (
int) $node[
"weight"]
116 throw new Setup\UnachievableException(
'wrong config type, expected ilGlobalCacheSettings');
129 return new Setup\Objective\NullObjective();
137 return new Setup\Objective\NullObjective();
161 'flushes all GlobalCaches.',
162 function () use ($config) {
An objective is a desired state of the system that is supposed to be created by the setup...
getStatusObjective(Setup\Metrics\Storage $storage)
Interface Observer Contains several chained tasks and infos about them.
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.if Config does not match the Agent...
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.if Agent has no Config ...
A agent is some component that performs part of the setup process.
getUpdateObjective(Setup\Config $config=null)
__construct(Refinery\Factory $refinery)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Refinery Factory $refinery
getNamedObjectives(?Config $config=null)
getInstallObjective(Setup\Config $config=null)
A configuration for the setup.
hasConfig()
Does this agent require a configuration?