ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilFileSystemSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
19 use ILIAS\Setup;
20 use ILIAS\Refinery;
21 use ILIAS\Data;
22 use ILIAS\UI;
23 
25 {
27 
28  protected Refinery\Factory $refinery;
29 
30  public function __construct(
31  Refinery\Factory $refinery
32  ) {
33  $this->refinery = $refinery;
34  }
35 
39  public function hasConfig(): bool
40  {
41  return true;
42  }
43 
48  {
49  return $this->refinery->custom()->transformation(fn($data): \ilFileSystemSetupConfig => new \ilFileSystemSetupConfig(
50  $data["data_dir"]
51  ));
52  }
53 
57  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
58  {
60  return new ilFileSystemDirectoriesCreatedObjective($config);
61  }
62 
66  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
67  {
68  if ($config) {
70  return new ilFileSystemConfigNotChangedObjective($config);
71  }
72  return new Setup\Objective\NullObjective();
73  }
74 
78  public function getBuildObjective(): Setup\Objective
79  {
80  return new Setup\Objective\NullObjective();
81  }
82 
86  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
87  {
88  return new ilFileSystemMetricsCollectedObjective($storage);
89  }
90 
94  public function getMigrations(): array
95  {
96  return [];
97  }
98 }
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.if Agent has no Config ...
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
hasConfig()
Does this agent require a configuration?
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
getUpdateObjective(Setup\Config $config=null)
getInstallObjective(Setup\Config $config=null)
Builds data types.
Definition: Factory.php:35
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.if Config does not match the Agent...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Refinery\Factory $refinery)
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...
getStatusObjective(Setup\Metrics\Storage $storage)
A configuration for the setup.
Definition: Config.php:26
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...