ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 @inheritDoc More...
 
 getNamedObjective (string $name, Setup\Config $config=null)
 

Data Fields

const PHP_MEMORY_LIMIT = "128M"
 

Protected Member Functions

 getPHPMemoryLimitCondition ()
 

Protected Attributes

 $refinery
 
 $data
 

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 15 of file class.ilSetupAgent.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

32 {
33 $this->refinery = $refinery;
34 $this->data = $data;
35 }

References $data, and $refinery.

Member Function Documentation

◆ getArrayToConfigTransformation()

ilSetupAgent::getArrayToConfigTransformation ( )

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

48 : Refinery\Transformation
49 {
50 return $this->refinery->custom()->transformation(function ($data) {
51 $datetimezone = $this->refinery->to()->toNew(\DateTimeZone::class);
52 return new \ilSetupConfig(
53 $this->data->clientId($data["client_id"] ?? ''),
54 $datetimezone->transform([$data["server_timezone"] ?? "UTC"]),
55 $data["register_nic"] ?? false
56 );
57 });
58 }

References $data.

◆ getBuildArtifactObjective()

ilSetupAgent::getBuildArtifactObjective ( )

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

120 : Setup\Objective
121 {
122 return new Setup\Objective\NullObjective();
123 }

◆ getInstallObjective()

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

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

63 : Setup\Objective
64 {
65 return new Setup\Objective\ObjectiveWithPreconditions(
68 new Setup\ObjectiveCollection(
69 "Complete common ILIAS objectives.",
70 false,
71 new Setup\Condition\PHPVersionCondition("7.2.0"),
72 new Setup\Condition\PHPExtensionLoadedCondition("dom"),
73 new Setup\Condition\PHPExtensionLoadedCondition("xsl"),
74 new Setup\Condition\PHPExtensionLoadedCondition("gd"),
77 $config->getRegisterNIC()
79 : new Setup\ObjectiveCollection(
80 "",
81 false,
84 )
85 )
86 );
87 }
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:68

References $config, and getPHPMemoryLimitCondition().

+ Here is the call graph for this function:

◆ getMigrations()

ilSetupAgent::getMigrations ( )

@inheritDoc

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

136 : array
137 {
138 return [];
139 }

◆ getNamedObjective()

ilSetupAgent::getNamedObjective ( string  $name,
Setup\Config  $config = null 
)

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

142 : Setup\Objective
143 {
144 if ($name == "registerNICKey") {
145 if (is_null($config)) {
146 throw new \RuntimeException(
147 "Missing Config for objective '$name'."
148 );
149 }
151 }
152 throw new \InvalidArgumentException(
153 "There is no named objective '$name'"
154 );
155 }
if($format !==null) $name
Definition: metadata.php:230

References $config, and $name.

◆ getPHPMemoryLimitCondition()

ilSetupAgent::getPHPMemoryLimitCondition ( )
protected

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

89 : Setup\Objective
90 {
91 return new Setup\Condition\ExternalConditionObjective(
92 "PHP memory limit >= " . self::PHP_MEMORY_LIMIT,
93 function (Setup\Environment $env) : bool {
94 $limit = ini_get("memory_limit");
95 if ($limit == -1) {
96 return true;
97 }
98 $expected = $this->data->dataSize(self::PHP_MEMORY_LIMIT);
99 $current = $this->data->dataSize($limit);
100 return $current->inBytes() >= $expected->inBytes();
101 },
102 "To properly execute ILIAS, please take care that the PHP memory limit is at least set to 128M."
103 );
104 }
An environment holds resources to be used in the setup process.
Definition: Environment.php:12

Referenced by getInstallObjective().

+ Here is the caller graph for this function:

◆ getStatusObjective()

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

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

128 : Setup\Objective
129 {
130 return new ilSetupMetricsCollectedObjective($storage);
131 }

◆ getUpdateObjective()

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

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

109 : Setup\Objective
110 {
111 if ($config !== null) {
113 }
114 return new Setup\Objective\NullObjective();
115 }

References $config.

◆ hasConfig()

ilSetupAgent::hasConfig ( )

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

40 : bool
41 {
42 return true;
43 }

Field Documentation

◆ $data

ilSetupAgent::$data
protected

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

Referenced by __construct(), and getArrayToConfigTransformation().

◆ $refinery

ilSetupAgent::$refinery
protected

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

Referenced by __construct().

◆ PHP_MEMORY_LIMIT

const ilSetupAgent::PHP_MEMORY_LIMIT = "128M"

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


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