ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 
24 class ilBackgroundTasksSetupAgent implements Setup\Agent
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 getBuildArtifactObjective(): 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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...