ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilSystemFolderSetupAgent.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 
5 use ILIAS\Setup;
7 use ILIAS\Data;
8 use ILIAS\UI;
9 
11 {
13 
17  protected $refinery;
18 
19  public function __construct(
21  ) {
22  $this->refinery = $refinery;
23  }
24 
28  public function hasConfig(): bool
29  {
30  return true;
31  }
32 
37  {
38  return $this->refinery->custom()->transformation(function ($data) {
39  return new \ilSystemFolderSetupConfig(
40  $data["client"]["name"] ?? null,
41  $data["client"]["description"] ?? null,
42  $data["client"]["institution"] ?? null,
43  $data["contact"]["firstname"],
44  $data["contact"]["lastname"],
45  $data["contact"]["title"] ?? null,
46  $data["contact"]["position"] ?? null,
47  $data["contact"]["institution"] ?? null,
48  $data["contact"]["street"] ?? null,
49  $data["contact"]["zipcode"] ?? null,
50  $data["contact"]["city"] ?? null,
51  $data["contact"]["country"] ?? null,
52  $data["contact"]["phone"] ?? null,
53  $data["contact"]["email"],
54  );
55  });
56  }
57 
61  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
62  {
63  return new ilInstallationInformationStoredObjective($config);
64  }
65 
69  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
70  {
71  if ($config !== null) {
72  return new ilInstallationInformationStoredObjective($config);
73  }
74  return new Setup\Objective\NullObjective();
75  }
76 
80  public function getBuildObjective(): Setup\Objective
81  {
82  return new Setup\Objective\NullObjective();
83  }
84 
88  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
89  {
90  return new ilSystemFolderMetricsCollectedObjective($storage);
91  }
92 
96  public function getMigrations(): array
97  {
98  return [];
99  }
100 }
getUpdateObjective(Setup\Config $config=null)
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.if Config does not match the Agent...
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
getInstallObjective(Setup\Config $config=null)
hasConfig()
Does this agent require a configuration?
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.if Agent has no Config ...
getStatusObjective(Setup\Metrics\Storage $storage)
Builds data types.
Definition: Factory.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A transformation is a function from one datatype to another.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Store information about the installation, like title, description and contact information in the acco...
A configuration for the setup.
Definition: Config.php:26
__construct(Refinery\Factory $refinery)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...