ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 

Protected Attributes

 $refinery
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilDatabaseSetupAgent::__construct ( Refinery  $refinery)

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

References $refinery.

19  {
20  $this->refinery = $refinery;
21  }

Member Function Documentation

◆ getArrayToConfigTransformation()

ilDatabaseSetupAgent::getArrayToConfigTransformation ( )

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

References $data, and $password.

35  {
36  // TODO: Migrate this to refinery-methods once possible.
37  return $this->refinery->custom()->transformation(function ($data) {
38  $data["password"] = $data["password"] ?? null; // password can be empty
39  $password = $this->refinery->to()->data("password");
40  return new \ilDatabaseSetupConfig(
41  $data["type"] ?? "innodb",
42  $data["host"] ?? "localhost",
43  $data["database"] ?? "ilias",
44  $data["user"] ?? null,
45  $data["password"] ? $password->transform($data["password"]) : null,
46  $data["create_database"] ?? true,
47  $data["collation"] ?? null,
48  $data["port"] ?? 3306,
49  $data["path_to_db_dump"] ?? null
50  );
51  });
52  }
$data
Definition: storeScorm.php:23
$password
Definition: cron.php:14
A transformation is a function from one datatype to another.

◆ getBuildArtifactObjective()

ilDatabaseSetupAgent::getBuildArtifactObjective ( )

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

88  : Setup\Objective
89  {
90  return new Setup\Objective\NullObjective();
91  }

◆ getInstallObjective()

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

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

References $config.

57  : Setup\Objective
58  {
59  return new Setup\ObjectiveCollection(
60  "Complete objectives from Services\Database",
61  false,
65  );
66  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

◆ getMigrations()

ilDatabaseSetupAgent::getMigrations ( )

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

104  : array
105  {
106  return [];
107  }

◆ getStatusObjective()

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

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

96  : Setup\Objective
97  {
98  return new ilDatabaseMetricsCollectedObjective($storage);
99  }

◆ getUpdateObjective()

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

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

References $config.

71  : Setup\Objective
72  {
73  $p = [];
74  if ($config !== null) {
75  $p[] = new \ilDatabaseConfigStoredObjective($config);
76  }
77  $p[] = new \ilDatabaseUpdatedObjective();
78  return new Setup\ObjectiveCollection(
79  "Complete objectives from Services\Database",
80  false,
81  ...$p
82  );
83  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

◆ hasConfig()

ilDatabaseSetupAgent::hasConfig ( )

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

26  : bool
27  {
28  return true;
29  }

Field Documentation

◆ $refinery

ilDatabaseSetupAgent::$refinery
protected

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

Referenced by __construct().


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