ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilDatabaseSetupAgent.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6use ILIAS\Data\Factory as DataFactory;
7use ILIAS\Refinery\Factory as Refinery;
9
11{
15 protected $refinery;
16
17 public function __construct(Refinery $refinery)
18 {
19 $this->refinery = $refinery;
20 }
21
25 public function hasConfig() : bool
26 {
27 return true;
28 }
29
33 public function getConfigInput(Setup\Config $config = null) : ILIAS\UI\Component\Input\Field\Input
34 {
35 throw new \LogicException("NYI!");
36 }
37
42 {
43 // TODO: Migrate this to refinery-methods once possible.
44 return $this->refinery->custom()->transformation(function ($data) {
45 $password = $this->refinery->to()->data("password");
46 return new \ilDatabaseSetupConfig(
47 $data["type"] ?? "innodb",
48 $data["host"] ?? "localhost",
49 $data["database"] ?? "ilias",
50 $data["user"] ?? null,
51 $data["password"] ? $password->transform($data["password"]) : null,
52 $data["create_database"] ?? true,
53 $data["collation"] ?? null,
54 $data["port"] ?? 3306,
55 $data["path_to_db_dump"] ?? null
56 );
57 });
58 }
59
63 public function getInstallObjective(Setup\Config $config = null) : Setup\Objective
64 {
66 "Complete objectives from Services\Database",
67 false,
70 );
71 }
72
76 public function getUpdateObjective(Setup\Config $config = null) : Setup\Objective
77 {
78 return new \ilDatabaseUpdatedObjective($config, false);
79 }
80
84 public function getBuildArtifactObjective() : Setup\Objective
85 {
86 return new Setup\NullObjective();
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
A non-objective, nothing to do to achieve it...
A objective collection is a objective that is achieved once all subobjectives are achieved.
getInstallObjective(Setup\Config $config=null)
@inheritdocs
getConfigInput(Setup\Config $config=null)
@inheritdocs
getArrayToConfigTransformation()
@inheritdocs
getUpdateObjective(Setup\Config $config=null)
@inheritdocs
$password
Definition: cron.php:14
A transformation is a function from one datatype to another.
A agent is some component that performs part of the setup process.
Definition: Agent.php:14
A configuration for the setup.
Definition: Config.php:11
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:15
A component is the most general form of an entity in the UI.
Definition: Component.php:14
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
$data
Definition: storeScorm.php:23