ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilMathJaxSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 use ILIAS\Setup;
21 use ILIAS\Refinery;
22 
24 {
26 
27  protected Refinery\Factory $refinery;
28 
29  public function __construct(Refinery\Factory $refinery)
30  {
31  $this->refinery = $refinery;
32  }
33 
37  public function hasConfig(): bool
38  {
39  return true;
40  }
41 
46  {
47  return $this->refinery->custom()->transformation(function ($data) {
48  return new ilMathJaxSetupConfig((array) $data);
49  });
50  }
51 
55  public function getInstallObjective(Setup\Config $config = null): Setup\Objective
56  {
58  return new ilMathJaxConfigStoredObjective($config);
59  }
60 
64  public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
65  {
67  if ($config !== null) {
68  return new Setup\ObjectiveCollection(
69  'MathJax configuration and database update',
70  false,
71  new ilMathJaxConfigStoredObjective($config),
73  );
74  } else {
76  }
77  }
78 
82  public function getBuildObjective(): Setup\Objective
83  {
84  return new Setup\Objective\NullObjective();
85  }
86 
90  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
91  {
92  return new ilMathJaxMetricsCollectedObjective($storage);
93  }
94 
98  public function getMigrations(): array
99  {
100  return [];
101  }
102 }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
getUpdateObjective(Config $config=null)
Get the goal the agent wants to achieve on update.
getStatusObjective(Setup\Metrics\Storage $storage)
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
__construct(Refinery\Factory $refinery)
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 ...
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.if Config does not match the Agent...
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.
A configuration for the setup.
Definition: Config.php:26