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 ()
 @inheritdocs More...
 
 getArrayToConfigTransformation ()
 @inheritdocs More...
 
 getInstallObjective (Setup\Config $config=null)
 @inheritdocs More...
 
 getUpdateObjective (Setup\Config $config=null)
 @inheritdocs More...
 
 getBuildArtifactObjective ()
 @inheritdocs More...
 
 getStatusObjective (Setup\Metrics\Storage $storage)
 
 getMigrations ()
 @inheritDoc More...
 

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.

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

References $refinery.

Member Function Documentation

◆ getArrayToConfigTransformation()

ilDatabaseSetupAgent::getArrayToConfigTransformation ( )

@inheritdocs

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

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 }
$password
Definition: cron.php:14
A transformation is a function from one datatype to another.
$data
Definition: storeScorm.php:23

References $data, and $password.

◆ getBuildArtifactObjective()

ilDatabaseSetupAgent::getBuildArtifactObjective ( )

@inheritdocs

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)

@inheritdocs

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

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

References $config.

◆ getMigrations()

ilDatabaseSetupAgent::getMigrations ( )

@inheritDoc

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.

◆ getUpdateObjective()

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

@inheritdocs

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

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 }

References $config.

◆ hasConfig()

ilDatabaseSetupAgent::hasConfig ( )

@inheritdocs

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: