ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDatabaseSetupAgent Class Reference
+ Inheritance diagram for ilDatabaseSetupAgent:
+ Collaboration diagram for ilDatabaseSetupAgent:

Public Member Functions

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

Protected Attributes

Refinery $refinery
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilDatabaseSetupAgent::__construct ( Refinery  $refinery)

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getArrayToConfigTransformation()

ilDatabaseSetupAgent::getArrayToConfigTransformation ( )

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

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

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

◆ getBuildArtifactObjective()

ilDatabaseSetupAgent::getBuildArtifactObjective ( )

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

102  : Setup\Objective
103  {
104  return new Setup\Objective\NullObjective();
105  }

◆ getInstallObjective()

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

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

References $config.

70  : Setup\Objective
71  {
72  if (!$config instanceof \ilDatabaseSetupConfig) {
73  return new Setup\Objective\NullObjective();
74  }
75  return new Setup\ObjectiveCollection(
76  "Complete objectives from Services\Database",
77  false,
81  );
82  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

◆ getMigrations()

ilDatabaseSetupAgent::getMigrations ( )

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

118  : array
119  {
120  return [
121  new Setup\ilMysqlMyIsamToInnoDbMigration()
122  ];
123  }

◆ getNamedObjectives()

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

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

125  : array
126  {
127  return [
128  'resetFailedSteps' => new Setup\ObjectiveConstructor(
129  'reset null-states in il_db_steps',
130  static fn (): Setup\Objective => new ilDatabaseResetStepsObjective()
131  )
132  ];
133  }
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 ( Setup\Metrics\Storage  $storage)

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

110  : Setup\Objective
111  {
112  return new ilDatabaseMetricsCollectedObjective($storage);
113  }

◆ getUpdateObjective()

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

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

87  : Setup\Objective
88  {
89  $p = [];
90  $p[] = new \ilDatabaseUpdatedObjective();
92  return new Setup\ObjectiveCollection(
93  "Complete objectives from Services\Database",
94  false,
95  ...$p
96  );
97  }

◆ hasConfig()

ilDatabaseSetupAgent::hasConfig ( )

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

39  : bool
40  {
41  return true;
42  }

Field Documentation

◆ $refinery

Refinery ilDatabaseSetupAgent::$refinery
protected

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

Referenced by __construct().


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