ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilUtilitiesSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 use ILIAS\Setup;
22 use ILIAS\Refinery;
23 
25 {
27 
28  protected Refinery\Factory $refinery;
29 
30  public function __construct(Refinery\Factory $refinery)
31  {
32  $this->refinery = $refinery;
33  }
34 
38  public function hasConfig(): bool
39  {
40  return true;
41  }
42 
47  {
48  return $this->refinery->custom()->transformation(function ($data) {
49  return new ilUtilitiesSetupConfig(
50  $data["path_to_convert"] ?? "/usr/bin/convert",
51  $data["path_to_zip"] ?? "/usr/bin/zip",
52  $data["path_to_unzip"] ?? "/usr/bin/unzip"
53  );
54  });
55  }
56 
60  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
61  {
63  return new ilUtilitiesConfigStoredObjective($config);
64  }
65 
69  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
70  {
71  if ($config !== null) {
73  return new ilUtilitiesConfigStoredObjective($config);
74  }
75  return new Setup\Objective\NullObjective();
76  }
77 
81  public function getBuildObjective(): Setup\Objective
82  {
83  return new Setup\Objective\NullObjective();
84  }
85 
89  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
90  {
91  return new ilUtilitiesMetricsCollectedObjective($storage);
92  }
93 
97  public function getMigrations(): array
98  {
99  return [];
100  }
101 }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.if Agent has no Config ...
getUpdateObjective(Config $config=null)
Get the goal the agent wants to achieve on update.
__construct(Refinery\Factory $refinery)
getInstallObjective(Config $config=null)
Get the goals the agent wants to achieve on setup.
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
Builds data types.
Definition: Factory.php:35
Stores configuration for the Utilities service (paths to various tools) in the according ini-fields...
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...
getStatusObjective(Setup\Metrics\Storage $storage)
A transformation is a function from one datatype to another.
hasConfig()
Does this agent require a configuration?
A configuration for the setup.
Definition: Config.php:26