ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSetupAgent Class Reference

Contains common objectives for the setup. More...

+ Inheritance diagram for ilSetupAgent:
+ Collaboration diagram for ilSetupAgent:

Public Member Functions

 __construct (Refinery\Factory $refinery, Data\Factory $data)
 
 hasConfig ()
 
 getArrayToConfigTransformation ()
 
 getInstallObjective (Setup\Config $config=null)
 
 getUpdateObjective (Setup\Config $config=null)
 
 getBuildArtifactObjective ()
 
 getStatusObjective (Setup\Metrics\Storage $storage)
 
 getMigrations ()
 
 getNamedObjectives (?Config $config=null)
 

Protected Member Functions

 getPHPMemoryLimitCondition ()
 

Protected Attributes

Refinery Factory $refinery
 
Data Factory $data
 

Private Attributes

const PHP_MEMORY_LIMIT = "128M"
 
const PHP_MIN_VERSION = "7.4.0"
 
const PHP_MAX_VERSION = "8.0.999"
 

Detailed Description

Contains common objectives for the setup.

Do not make additions here, in general all this stuff here is supposed to go elsewhere once we find out which service it really belongs to.

Definition at line 32 of file class.ilSetupAgent.php.

Constructor & Destructor Documentation

◆ __construct()

ilSetupAgent::__construct ( Refinery\Factory  $refinery,
Data\Factory  $data 
)

Definition at line 41 of file class.ilSetupAgent.php.

References $data, $refinery, and ILIAS\Repository\refinery().

44  {
45  $this->refinery = $refinery;
46  $this->data = $data;
47  }
Data Factory $data
Refinery Factory $refinery
+ Here is the call graph for this function:

Member Function Documentation

◆ getArrayToConfigTransformation()

ilSetupAgent::getArrayToConfigTransformation ( )

Definition at line 60 of file class.ilSetupAgent.php.

References ILIAS\Repository\refinery().

60  : Refinery\Transformation
61  {
62  return $this->refinery->custom()->transformation(function ($data) {
63  $datetimezone = $this->refinery->to()->toNew(\DateTimeZone::class);
64  return new \ilSetupConfig(
65  $this->data->clientId($data["client_id"] ?? ''),
66  $datetimezone->transform([$data["server_timezone"] ?? "UTC"]),
67  $data["register_nic"] ?? false
68  );
69  });
70  }
Data Factory $data
+ Here is the call graph for this function:

◆ getBuildArtifactObjective()

ilSetupAgent::getBuildArtifactObjective ( )

Definition at line 145 of file class.ilSetupAgent.php.

145  : Setup\Objective
146  {
147  return new Setup\Objective\NullObjective();
148  }

◆ getInstallObjective()

ilSetupAgent::getInstallObjective ( Setup\Config  $config = null)

Definition at line 75 of file class.ilSetupAgent.php.

References $config, and getPHPMemoryLimitCondition().

75  : Setup\Objective
76  {
77  return new Setup\Objective\ObjectiveWithPreconditions(
80  new Setup\ObjectiveCollection(
81  "Complete common ILIAS objectives.",
82  false,
83  new Setup\Condition\PHPVersionCondition(self::PHP_MIN_VERSION, self::PHP_MAX_VERSION, true),
84  new Setup\Condition\PHPExtensionLoadedCondition("dom"),
85  new Setup\Condition\PHPExtensionLoadedCondition("xsl"),
86  new Setup\Condition\PHPExtensionLoadedCondition("gd"),
89  $config->getRegisterNIC()
91  : new Setup\ObjectiveCollection(
92  "",
93  false,
96  )
97  )
98  );
99  }
A objective collection is a objective that is achieved once all subobjectives are achieved...
There seems to already exist an ILIAS installation, an interaction with it should be confirmed...
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
+ Here is the call graph for this function:

◆ getMigrations()

ilSetupAgent::getMigrations ( )

Definition at line 161 of file class.ilSetupAgent.php.

161  : array
162  {
163  return [];
164  }

◆ getNamedObjectives()

ilSetupAgent::getNamedObjectives ( ?Config  $config = null)

Definition at line 166 of file class.ilSetupAgent.php.

References $config.

166  : array
167  {
168  return [
169  "registerNICKey" => new Setup\ObjectiveConstructor(
170  "Register NIC key",
171  static function () use ($config): Setup\Objective {
172  if (is_null($config)) {
173  throw new \RuntimeException(
174  "Missing Config for objective 'registerNICKey'."
175  );
176  }
177 
179  }
180  )
181  ];
182  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

◆ getPHPMemoryLimitCondition()

ilSetupAgent::getPHPMemoryLimitCondition ( )
protected

Definition at line 101 of file class.ilSetupAgent.php.

Referenced by getInstallObjective().

101  : Setup\Objective
102  {
103  return new Setup\Condition\ExternalConditionObjective(
104  "PHP memory limit >= " . self::PHP_MEMORY_LIMIT,
105  function (Setup\Environment $env): bool {
106  $limit = ini_get("memory_limit");
107  if ($limit == -1) {
108  return true;
109  }
110  $expected = $this->data->dataSize(self::PHP_MEMORY_LIMIT);
111  $current = $this->data->dataSize($limit);
112  return $current->inBytes() >= $expected->inBytes();
113  },
114  "To properly execute ILIAS, please take care that the PHP memory limit is at least set to 128M."
115  );
116  }
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
+ Here is the caller graph for this function:

◆ getStatusObjective()

ilSetupAgent::getStatusObjective ( Setup\Metrics\Storage  $storage)

Definition at line 153 of file class.ilSetupAgent.php.

153  : Setup\Objective
154  {
155  return new ilSetupMetricsCollectedObjective($storage);
156  }

◆ getUpdateObjective()

ilSetupAgent::getUpdateObjective ( Setup\Config  $config = null)

Definition at line 121 of file class.ilSetupAgent.php.

References $config, and $objectives.

121  : Setup\Objective
122  {
123  $objectives = [
124  new Setup\Objective\ObjectiveWithPreconditions(
125  new ilVersionWrittenToSettingsObjective($this->data),
126  new Setup\Condition\PHPVersionCondition(self::PHP_MIN_VERSION, self::PHP_MAX_VERSION, true),
129  )
130  ];
131  if ($config !== null) {
133  }
134 
135  return new Setup\ObjectiveCollection(
136  "Complete common ILIAS objectives.",
137  false,
138  ...$objectives
139  );
140  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
$objectives

◆ hasConfig()

ilSetupAgent::hasConfig ( )

Definition at line 52 of file class.ilSetupAgent.php.

52  : bool
53  {
54  return true;
55  }

Field Documentation

◆ $data

Data Factory ilSetupAgent::$data
protected

Definition at line 39 of file class.ilSetupAgent.php.

Referenced by __construct().

◆ $refinery

Refinery Factory ilSetupAgent::$refinery
protected

Definition at line 38 of file class.ilSetupAgent.php.

Referenced by __construct().

◆ PHP_MAX_VERSION

const ilSetupAgent::PHP_MAX_VERSION = "8.0.999"
private

Definition at line 36 of file class.ilSetupAgent.php.

◆ PHP_MEMORY_LIMIT

const ilSetupAgent::PHP_MEMORY_LIMIT = "128M"
private

Definition at line 34 of file class.ilSetupAgent.php.

◆ PHP_MIN_VERSION

const ilSetupAgent::PHP_MIN_VERSION = "7.4.0"
private

Definition at line 35 of file class.ilSetupAgent.php.


The documentation for this class was generated from the following file: