ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Setup.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
24
25class Setup implements Component\Component
26{
27 public function init(
28 array | \ArrayAccess &$define,
29 array | \ArrayAccess &$implement,
30 array | \ArrayAccess &$use,
31 array | \ArrayAccess &$contribute,
32 array | \ArrayAccess &$seek,
33 array | \ArrayAccess &$provide,
34 array | \ArrayAccess &$pull,
35 array | \ArrayAccess &$internal,
36 ): void {
37 $contribute[EntryPoint::class] = static fn() =>
38 new \ILIAS\Setup\CLI\App(
39 $internal["command.install"],
40 $internal["command.update"],
41 $internal["command.build"],
42 $internal["command.achieve"],
43 $internal["command.status"],
44 $internal["command.migrate"]
45 );
46
47 $contribute[\ILIAS\Setup\Agent::class] = static fn() =>
48 new \ilCommonSetupAgent(
49 $pull[\ILIAS\Refinery\Factory::class],
50 $pull[\ILIAS\Data\Factory::class]
51 );
52
53 $define[] = \ILIAS\Setup\AgentFinder::class;
54 $implement[\ILIAS\Setup\AgentFinder::class] = static fn(): \ILIAS\Setup\ImplementationOfAgentFinder =>
55 $internal["agent_finder"];
56
57 $contribute[\ILIAS\Component\Activities\Activity::class] = static fn() =>
58 new \ILIAS\Setup\Activities\GetStatus();
59
60 $internal["command.install"] = static fn() =>
61 new \ILIAS\Setup\CLI\InstallCommand(
62 $internal["agent_finder"],
63 $internal["config_reader"],
64 $internal["common_preconditions"]
65 );
66 $internal["command.update"] = static fn() =>
67 new \ILIAS\Setup\CLI\UpdateCommand(
68 $internal["agent_finder"],
69 $internal["config_reader"],
70 $internal["common_preconditions"]
71 );
72 $internal["command.build"] = static fn() =>
73 new \ILIAS\Setup\CLI\BuildCommand(
74 $internal["agent_finder"]
75 );
76 $internal["command.achieve"] = static fn() =>
77 new \ILIAS\Setup\CLI\AchieveCommand(
78 $internal["agent_finder"],
79 $internal["config_reader"],
80 $internal["common_preconditions"],
81 $pull[\ILIAS\Refinery\Factory::class],
82 );
83 $internal["command.status"] = static fn() =>
84 new \ILIAS\Setup\CLI\StatusCommand(
85 $internal["agent_finder"]
86 );
87 $internal["command.migrate"] = static fn() =>
88 new \ILIAS\Setup\CLI\MigrateCommand(
89 $internal["agent_finder"],
90 $internal["common_preconditions"]
91 );
92
93 $internal["common_preconditions"] = static fn() =>
94 [
95 new \ilOwnRiskConfirmedObjective(),
96 new \ilUseRootConfirmed()
97 ];
98
99 $internal["agent_finder"] = static fn() =>
100 new \ILIAS\Setup\ImplementationOfAgentFinder(
101 $pull[\ILIAS\Refinery\Factory::class],
102 $pull[\ILIAS\Data\Factory::class],
103 $use[\ILIAS\Language\Language::class],
104 $internal["interface_finder"],
105 $seek[\ILIAS\Setup\Agent::class]
106 );
107
108 $internal["config_reader"] = static fn() =>
109 new \ILIAS\Setup\CLI\ConfigReader(
110 $internal["json.parser"]
111 );
112
113 $internal["interface_finder"] = static fn() =>
114 new \ILIAS\Setup\ImplementationOfInterfaceFinder();
115
116 $internal["json.parser"] = static fn() =>
117 new \Seld\JsonLint\JsonParser();
118 }
119}
init(array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
Definition: Setup.php:27
An entrypoint is where the programm execution starts.
Definition: EntryPoint.php:28
A component is the most general form of an entity in the UI.
Definition: Component.php:28
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.