ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Setup\CLI\UpdateCommand Class Reference

Update command. More...

+ Inheritance diagram for ILIAS\Setup\CLI\UpdateCommand:
+ Collaboration diagram for ILIAS\Setup\CLI\UpdateCommand:

Public Member Functions

 __construct (AgentFinder $agent_finder, ConfigReader $config_reader, array $preconditions)
 
 configure ()
 
 execute (InputInterface $input, OutputInterface $output)
 

Protected Attributes

 $preconditions
 var Objective[] More...
 

Static Protected Attributes

static $defaultName = "update"
 

Detailed Description

Update command.

Definition at line 22 of file UpdateCommand.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\CLI\UpdateCommand::__construct ( AgentFinder  $agent_finder,
ConfigReader  $config_reader,
array  $preconditions 
)

Definition at line 38 of file UpdateCommand.php.

39 {
41 $this->agent_finder = $agent_finder;
42 $this->config_reader = $config_reader;
43 $this->preconditions = $preconditions;
44 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\Setup\CLI\UpdateCommand\$preconditions, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ configure()

ILIAS\Setup\CLI\UpdateCommand::configure ( )

Definition at line 46 of file UpdateCommand.php.

47 {
48 $this->setDescription("Updates an existing ILIAS installation");
49 $this->addArgument("config", InputArgument::OPTIONAL, "Configuration file for the update");
50 $this->addOption("config", null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, "Define fields in the configuration file that should be overwritten, e.g. \"a.b.c=foo\"", []);
51 $this->addOption("ignore-db-update-messages", null, InputOption::VALUE_NONE, "Ignore messages from the database update steps.");
52 $this->addOption("yes", "y", InputOption::VALUE_NONE, "Confirm every message of the update.");
54 }
configureCommandForPlugins()
Definition: HasAgent.php:21

References ILIAS\Setup\CLI\configureCommandForPlugins().

+ Here is the call graph for this function:

◆ execute()

ILIAS\Setup\CLI\UpdateCommand::execute ( InputInterface  $input,
OutputInterface  $output 
)

Definition at line 56 of file UpdateCommand.php.

57 {
58 // ATTENTION: This is a hack to get around the usage of the echo/exit pattern in
59 // the setup for the command line version of the setup. Do not use this.
60 if ($input->hasOption("ignore-db-update-messages") && $input->getOption("ignore-db-update-messages")) {
61 define("ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES", true);
62 }
63
64 $io = new IOWrapper($input, $output);
65 $io->printLicenseMessage();
66 $io->title("Update ILIAS");
67
68 $agent = $this->getRelevantAgent($input);
69
70 if ($input->getArgument("config")) {
71 $config = $this->readAgentConfig($agent, $input);
72 } else {
73 $config = null;
74 }
75
76 $objective = $agent->getUpdateObjective($config);
77 if (count($this->preconditions) > 0) {
78 $objective = new ObjectiveWithPreconditions(
79 $objective,
80 ...$this->preconditions
81 );
82 }
83
84 $environment = new ArrayEnvironment([
86 ]);
87 if ($config) {
88 $environment = $this->addAgentConfigsToEnvironment($agent, $config, $environment);
89 }
90
91 try {
92 $this->achieveObjective($objective, $environment, $io);
93 $io->success("Update complete. Thanks and have fun!");
94 } catch (NoConfirmationException $e) {
95 $io->error("Aborting Update, a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
96 }
97 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:28
readAgentConfig(Agent $agent, InputInterface $input)

References $config, Vendor\Package\$e, ILIAS\Setup\CLI\addAgentConfigsToEnvironment(), ILIAS\Setup\CLI\getRelevantAgent(), ILIAS\Setup\CLI\readAgentConfig(), and ILIAS\Setup\Environment\RESOURCE_ADMIN_INTERACTION.

+ Here is the call graph for this function:

Field Documentation

◆ $defaultName

ILIAS\Setup\CLI\UpdateCommand::$defaultName = "update"
staticprotected

Definition at line 28 of file UpdateCommand.php.

◆ $preconditions

ILIAS\Setup\CLI\UpdateCommand::$preconditions
protected

var Objective[]

Definition at line 33 of file UpdateCommand.php.

Referenced by ILIAS\Setup\CLI\UpdateCommand\__construct().


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