ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTreeSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 use ILIAS\Setup;
30 
31 class ilTreeSetupAgent implements Agent
32 {
33  protected Refinery $refinery;
34 
35  public function __construct(Refinery $refinery)
36  {
37  $this->refinery = $refinery;
38  }
39 
40  public function hasConfig(): bool
41  {
42  return false;
43  }
44 
46  {
47  return $this->refinery->custom()->transformation(static function ($data): Config {
48  return new NullConfig();
49  });
50  }
51 
52  public function getInstallObjective(Config $config = null): Objective
53  {
54  return new Objective\NullObjective();
55  }
56 
57  public function getUpdateObjective(Config $config = null): Objective
58  {
60  }
61 
63  {
64  return new Objective\NullObjective();
65  }
66 
67  public function getStatusObjective(Metrics\Storage $storage): Objective
68  {
69  return new Setup\ObjectiveCollection(
70  'Services/Tree',
71  true,
74  );
75  }
76 
77  public function getMigrations(): array
78  {
79  return [];
80  }
81 
82  public function getNamedObjectives(?Config $config = null): array
83  {
84  return [
85  'mp-to-ns' => new ObjectiveConstructor(
86  'Migrate the ILIAS repository tree from Materialized Path to Nested Set',
87  static function (): Objective {
88  return new ilTreeImplementationSwitch(
90  );
91  }
92  ),
93  'ns-to-mp' => new ObjectiveConstructor(
94  'Migrate the ILIAS repository tree from Nested to Materialized Path',
95  static function (): Objective {
96  return new ilTreeImplementationSwitch(
98  );
99  }
100  )
101  ];
102  }
103 }
hasConfig()
Does this agent require a configuration?
getStatusObjective(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...
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
__construct(Refinery $refinery)
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
A agent is some component that performs part of the setup process.
Definition: Agent.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMigrations()
Get a named map of migrations available for this Agent.
getNamedObjectives(?Config $config=null)
Gets all named objectives The keys of the returned array are the commands.
getBuildArtifactObjective()
Get the goal the agent wants to achieve to build artifacts.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInstallObjective(Config $config=null)
Get the goals the agent wants to achieve on setup.
A transformation is a function from one datatype to another.
getUpdateObjective(Config $config=null)
Get the goal the agent wants to achieve on update.
A configuration for the setup.
Definition: Config.php:26
A configuration with no content.
Definition: NullConfig.php:26
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...