ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ReloadControlStructureCommand.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4namespace ILIAS\Setup\CLI;
5
14use Symfony\Component\Console\Input\InputInterface;
15
20{
21 protected static $defaultName = "reload-control-structure";
22
23 public function configure()
24 {
25 parent::configure();
26 $this->setDescription("Reloads the control structure of the installation.");
27 }
28
29 protected function printIntroMessage(IOWrapper $io)
30 {
31 $io->title("Reloading control structure of ILIAS");
32 }
33
34 protected function printOutroMessage(IOWrapper $io)
35 {
36 $io->success("Control structure reloaded. Thanks and have fun!");
37 }
38
40 {
41 $environment = new ArrayEnvironment([
43 // TODO: This needs to be implemented correctly...
45 public function trackAchievementOf(Objective $objective) : void
46 {
47 }
48 public function isAchieved(Objective $objective) : bool
49 {
50 return false;
51 }
52 }
53 ]);
54
55 if ($agent instanceof AgentCollection && $config) {
56 foreach ($config->getKeys() as $k) {
57 $environment = $environment->withConfigFor($k, $config->getConfig($k));
58 }
59 }
60
61 return $environment;
62 }
63
65 {
66 // ATTENTION: This is not how we want to do this in general during the
67 // setup, stuff should use Dependency Injection. However, since we
68 // currently won't get there with the control structure but still need
69 // a quick way to reload it, we do it anyway.
70 return new ObjectiveCollection(
71 "Install and update ILIAS",
72 false,
75 ),
77 );
78 }
79}
An exception for terminatinating execution or to throw for unit testing.
An agent that is just a collection of some other agents.
withConfigFor(string $component, $config)
Stores a config for some component in the environment.RuntimeException if this config is already in t...
Command base class.
Definition: BaseCommand.php:24
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Definition: IOWrapper.php:17
success(string $text)
Definition: IOWrapper.php:91
title(string $title)
Definition: IOWrapper.php:86
buildEnvironment(Agent $agent, ?Config $config, IOWrapper $io)
A objective collection is a objective that is achieved once all subobjectives are achieved.
Class ilCtrlStructureReader.
Tracks the achievement of objectives.
A agent is some component that performs part of the setup process.
Definition: Agent.php:14
A configuration for the setup.
Definition: Config.php:11
An environment holds resources to be used in the setup process.
Definition: Environment.php:12
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:15
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68