ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTreeSetupAgent Class Reference
+ Inheritance diagram for ilTreeSetupAgent:
+ Collaboration diagram for ilTreeSetupAgent:

Public Member Functions

 __construct (Refinery $refinery)
 
 hasConfig ()
 Does this agent require a configuration? More...
 
 getArrayToConfigTransformation ()
 Agents must be able to tell how to create a configuration from a nested array. More...
 
 getInstallObjective (Config $config=null)
 Get the goals the agent wants to achieve on setup. More...
 
 getUpdateObjective (Config $config=null)
 Get the goal the agent wants to achieve on update. More...
 
 getBuildArtifactObjective ()
 Get the goal the agent wants to achieve to build artifacts. More...
 
 getStatusObjective (Metrics\Storage $storage)
 
 getMigrations ()
 Get a named map of migrations available for this Agent. More...
 
 getNamedObjectives (?Config $config=null)
 Gets all named objectives The keys of the returned array are the commands. More...
 
- Public Member Functions inherited from ILIAS\Setup\Agent
 getStatusObjective (Metrics\Storage $storage)
 Get the objective to be achieved when status is requested. More...
 

Protected Attributes

Refinery $refinery
 

Detailed Description

Definition at line 31 of file class.ilTreeSetupAgent.php.

Constructor & Destructor Documentation

◆ __construct()

ilTreeSetupAgent::__construct ( Refinery  $refinery)

Definition at line 35 of file class.ilTreeSetupAgent.php.

References $refinery, and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ getArrayToConfigTransformation()

ilTreeSetupAgent::getArrayToConfigTransformation ( )

Agents must be able to tell how to create a configuration from a nested array.

Exceptions
LogicExceptionif Agent has no Config

Implements ILIAS\Setup\Agent.

Definition at line 45 of file class.ilTreeSetupAgent.php.

References $data, and ILIAS\Repository\refinery().

46  {
47  return $this->refinery->custom()->transformation(static function ($data): Config {
48  return new NullConfig();
49  });
50  }
A transformation is a function from one datatype to another.
A configuration for the setup.
Definition: Config.php:26
A configuration with no content.
Definition: NullConfig.php:26
+ Here is the call graph for this function:

◆ getBuildArtifactObjective()

ilTreeSetupAgent::getBuildArtifactObjective ( )

Get the goal the agent wants to achieve to build artifacts.

Exceptions
InvalidArgumentExceptionif Config does not match the Agent.

Implements ILIAS\Setup\Agent.

Definition at line 62 of file class.ilTreeSetupAgent.php.

62  : Objective
63  {
64  return new Objective\NullObjective();
65  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30

◆ getInstallObjective()

ilTreeSetupAgent::getInstallObjective ( Config  $config = null)

Get the goals the agent wants to achieve on setup.

The provided configuration is to be used to set according configuration values in the installation.

Exceptions
InvalidArgumentExceptionif Config does not match the Agent..

Implements ILIAS\Setup\Agent.

Definition at line 52 of file class.ilTreeSetupAgent.php.

52  : Objective
53  {
54  return new Objective\NullObjective();
55  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30

◆ getMigrations()

ilTreeSetupAgent::getMigrations ( )

Get a named map of migrations available for this Agent.

Should also return Migrations that have run completely.

Returns
array<string,Migration>|Migration[]

Implements ILIAS\Setup\Agent.

Definition at line 77 of file class.ilTreeSetupAgent.php.

77  : array
78  {
79  return [];
80  }

◆ getNamedObjectives()

ilTreeSetupAgent::getNamedObjectives ( ?Config  $config = null)

Gets all named objectives The keys of the returned array are the commands.

Only the AgentCollection should return an array where the cmd of the named objective is the array key.

Parameters
Config | null$config
Returns
array<string|int, ObjectiveConstructor>

Implements ILIAS\Setup\Agent.

Definition at line 82 of file class.ilTreeSetupAgent.php.

References ilTreeImplementationSwitch\MATERIALIZED_PATH_TO_NESTED_SET, and ilTreeImplementationSwitch\NESTED_SET_TO_MATERIALIZED_PATH.

82  : 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  }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30

◆ getStatusObjective()

ilTreeSetupAgent::getStatusObjective ( Metrics\Storage  $storage)

Definition at line 67 of file class.ilTreeSetupAgent.php.

67  : Objective
68  {
69  return new Setup\ObjectiveCollection(
70  'Services/Tree',
71  true,
74  );
75  }
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...

◆ getUpdateObjective()

ilTreeSetupAgent::getUpdateObjective ( Config  $config = null)

Get the goal the agent wants to achieve on update.

The provided configuration is to be used to change according configuration values in the installation. If this is not possible for some reason, an according UnachievableException needs to be thrown in the according objective.

The configuration is not to be used to initialize the required environment for the objectives. This must be done via ClientIdReadObjective and depending objectives like ilIniFilesLoadedObjective.

If no configuration is provided the configuration of the component should stay as is.

Exceptions
InvalidArgumentExceptionif Config does not match the Agent..

Implements ILIAS\Setup\Agent.

Definition at line 57 of file class.ilTreeSetupAgent.php.

57  : Objective
58  {
60  }
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...

◆ hasConfig()

ilTreeSetupAgent::hasConfig ( )

Does this agent require a configuration?

Implements ILIAS\Setup\Agent.

Definition at line 40 of file class.ilTreeSetupAgent.php.

40  : bool
41  {
42  return false;
43  }

Field Documentation

◆ $refinery

Refinery ilTreeSetupAgent::$refinery
protected

Definition at line 33 of file class.ilTreeSetupAgent.php.

Referenced by __construct().


The documentation for this class was generated from the following file: