ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilStyleSetupAgent.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 
31  protected $refinery;
32 
33  public function __construct(
35  ) {
36  $this->refinery = $refinery;
37  }
38 
42  public function hasConfig(): bool
43  {
44  return true;
45  }
46 
51  {
52  return $this->refinery->custom()->transformation(function ($data) {
53  return new \ilStyleSetupConfig(
54  $data["manage_system_styles"] ?? false,
55  $data["path_to_scss"] ?? null
56  );
57  });
58  }
59 
63  public function getInstallObjective(?Setup\Config $config = null): Setup\Objective
64  {
65  return new ilStyleConfigStoredObjective($config);
66  }
67 
71  public function getUpdateObjective(?Setup\Config $config = null): Setup\Objective
72  {
73  if ($config !== null) {
74  return new ilStyleConfigStoredObjective($config);
75  }
76  return new Setup\Objective\NullObjective();
77  }
78 
82  public function getBuildObjective(): Setup\Objective
83  {
85  }
86 
90  public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
91  {
92  return new ilStyleMetricsCollectedObjective($storage);
93  }
94 
98  public function getMigrations(): array
99  {
100  return [
102  ];
103  }
104 
105  public function getNamedObjectives(?Setup\Config $config = null): array
106  {
107  return [
108  'buildUIFrameworkExampleTestCases.update' => new Setup\ObjectiveConstructor(
109  'builds an import file for testrail for all KNOWN ids.',
110  fn() => new ilUITestRailExampleTestCasesObjective(false)
111  ),
112 
113  'buildUIFrameworkExampleTestCases.new' => new Setup\ObjectiveConstructor(
114  'builds an import file for testrail with ONLY NEW cases.',
115  fn() => new ilUITestRailExampleTestCasesObjective(true)
116  ),
117 
118 
119  ];
120  }
121 }
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...
__construct(Refinery\Factory $refinery)
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.if Agent has no Config ...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getInstallObjective(?Setup\Config $config=null)
Storage is simple key/value store without further schema definition.
Definition: Storage.php:29
getNamedObjectives(?Setup\Config $config=null)
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...
getUpdateObjective(?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...
hasConfig()
Does this agent require a configuration?
A configuration for the setup.
Definition: Config.php:26