ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilBackgroundTasksSetupAgent.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): \ilBackgroundTasksSetupConfig => new \ilBackgroundTasksSetupConfig(
51  $data["max_number_of_concurrent_tasks"] ?? 1
52  ));
53  }
54 
58  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
59  {
61  return new ilBackgroundTasksConfigStoredObjective($config);
62  }
63 
67  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
68  {
69  if ($config !== null) {
71  return new ilBackgroundTasksConfigStoredObjective($config);
72  }
73  return new Setup\Objective\NullObjective();
74  }
75 
79  public function getBuildObjective(): Setup\Objective
80  {
81  return new Setup\Objective\NullObjective();
82  }
83 
87  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
88  {
89  return new Setup\ObjectiveCollection(
90  'Component BackgroundTasks',
91  true,
94  );
95  }
96 
100  public function getMigrations(): array
101  {
102  return [];
103  }
104 }
getStatusObjective(Setup\Metrics\Storage $storage)
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
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...
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 ...
getInstallObjective(Setup\Config $config=null)
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...
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...