ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilDatabaseSetupAgent Class Reference
+ Inheritance diagram for ilDatabaseSetupAgent:
+ Collaboration diagram for ilDatabaseSetupAgent:

Public Member Functions

 __construct (protected Refinery $refinery)
 
 hasConfig ()
 
 getArrayToConfigTransformation ()
 
 getInstallObjective (?Config $config=null)
 
 getUpdateObjective (?Config $config=null)
 
 getBuildObjective ()
 
 getStatusObjective (Storage $storage)
 
 getMigrations ()
 
 getNamedObjectives (?Config $config=null)
 
- Public Member Functions inherited from ILIAS\Setup\Agent
 getInstallObjective (?Config $config=null)
 Get the goals the agent wants to achieve on setup. More...
 
 getUpdateObjective (?Config $config=null)
 Get the goal the agent wants to achieve on update. More...
 
 getStatusObjective (Metrics\Storage $storage)
 Get the objective to be achieved when status is requested. More...
 
 getNamedObjectives (?Config $config=null)
 Gets all named objectives The keys of the returned array are the commands. More...
 

Detailed Description

Definition at line 33 of file class.ilDatabaseSetupAgent.php.

Constructor & Destructor Documentation

◆ __construct()

ilDatabaseSetupAgent::__construct ( protected Refinery  $refinery)

Definition at line 37 of file class.ilDatabaseSetupAgent.php.

38  {
39  }

Member Function Documentation

◆ getArrayToConfigTransformation()

ilDatabaseSetupAgent::getArrayToConfigTransformation ( )

Implements ILIAS\Setup\Agent.

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

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

53  {
54  // TODO: Migrate this to refinery-methods once possible.
55  return $this->refinery->custom()->transformation(function ($data): \ilDatabaseSetupConfig {
56  $data["password"] ??= null; // password can be empty
57  $password = $this->refinery->to()->data("password");
58  return new \ilDatabaseSetupConfig(
59  $data["type"] ?? "innodb",
60  $data["host"] ?? "localhost",
61  $data["database"] ?? "ilias",
62  $data["user"] ?? null,
63  $data["password"] ? $password->transform($data["password"]) : null,
64  $data["create_database"] ?? true,
65  $data["collation"] ?? null,
66  (int) ($data["port"] ?? 3306),
67  $data["path_to_db_dump"] ?? null
68  );
69  });
70  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
A transformation is a function from one datatype to another.
+ Here is the call graph for this function:

◆ getBuildObjective()

ilDatabaseSetupAgent::getBuildObjective ( )

Implements ILIAS\Setup\Agent.

Definition at line 107 of file class.ilDatabaseSetupAgent.php.

107  : Objective
108  {
109  return new NullObjective();
110  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
A non-objective, nothing to do to achieve it...

◆ getInstallObjective()

ilDatabaseSetupAgent::getInstallObjective ( ?Config  $config = null)

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

75  : Objective
76  {
77  if (!$config instanceof \ilDatabaseSetupConfig) {
78  return new NullObjective();
79  }
80  return new ObjectiveCollection(
81  "Complete objectives from Services\Database",
82  false,
86  );
87  }
A objective collection is a objective that is achieved once all subobjectives are achieved...
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
A non-objective, nothing to do to achieve it...

◆ getMigrations()

ilDatabaseSetupAgent::getMigrations ( )

Implements ILIAS\Setup\Agent.

Definition at line 123 of file class.ilDatabaseSetupAgent.php.

123  : array
124  {
125  return [
127  ];
128  }

◆ getNamedObjectives()

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

Definition at line 130 of file class.ilDatabaseSetupAgent.php.

130  : array
131  {
132  return [
133  'resetFailedSteps' => new ObjectiveConstructor(
134  'reset null-states in il_db_steps',
135  static fn(): Objective => new ilDatabaseResetStepsObjective()
136  )
137  ];
138  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30

◆ getStatusObjective()

ilDatabaseSetupAgent::getStatusObjective ( Storage  $storage)

Definition at line 115 of file class.ilDatabaseSetupAgent.php.

115  : Objective
116  {
117  return new ilDatabaseMetricsCollectedObjective($storage);
118  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30

◆ getUpdateObjective()

ilDatabaseSetupAgent::getUpdateObjective ( ?Config  $config = null)

Definition at line 92 of file class.ilDatabaseSetupAgent.php.

92  : Objective
93  {
94  $p = [];
95  $p[] = new \ilDatabaseUpdatedObjective();
97  return new ObjectiveCollection(
98  "Complete objectives from Services\Database",
99  false,
100  ...$p
101  );
102  }
A objective collection is a objective that is achieved once all subobjectives are achieved...
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30

◆ hasConfig()

ilDatabaseSetupAgent::hasConfig ( )

Implements ILIAS\Setup\Agent.

Definition at line 44 of file class.ilDatabaseSetupAgent.php.

44  : bool
45  {
46  return true;
47  }

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