ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 

Protected Member Functions

 configure ()
 
 execute (InputInterface $input, OutputInterface $output)
 

Protected Attributes

array $preconditions
 var Objective[] More...
 

Static Protected Attributes

static $defaultName = "update"
 

Detailed Description

Update command.

Definition at line 38 of file UpdateCommand.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 54 of file UpdateCommand.php.

55 {
57 $this->agent_finder = $agent_finder;
58 $this->config_reader = $config_reader;
59 $this->preconditions = $preconditions;
60 }
array $preconditions
var Objective[]
__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 ( )
protected

Definition at line 62 of file UpdateCommand.php.

62 : void
63 {
64 $this->setDescription("Updates an existing ILIAS installation");
65 $this->addArgument("config", InputArgument::OPTIONAL, "Configuration file for the update");
66 $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\"", []);
67 $this->addOption("ignore-db-update-messages", null, InputOption::VALUE_NONE, "Ignore messages from the database update steps.");
68 $this->addOption("yes", "y", InputOption::VALUE_NONE, "Confirm every message of the update.");
70 }
configureCommandForPlugins()
Definition: HasAgent.php:33

References ILIAS\Setup\CLI\configureCommandForPlugins().

+ Here is the call graph for this function:

◆ execute()

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

Definition at line 72 of file UpdateCommand.php.

72 : int
73 {
74 // ATTENTION: This is a hack to get around the usage of the echo/exit pattern in
75 // the setup for the command line version of the setup. Do not use this.
76 if ($input->hasOption("ignore-db-update-messages") && $input->getOption("ignore-db-update-messages")) {
77 define("ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES", true);
78 }
79
80 $io = new IOWrapper($input, $output);
81 $io->printLicenseMessage();
82 $io->title("Update ILIAS");
83
84 $agent = $this->getRelevantAgent($input);
85
86 if ($input->getArgument("config")) {
87 $config = $this->readAgentConfig($agent, $input);
88 } else {
89 $config = null;
90 }
91
92 $objective = $agent->getUpdateObjective($config);
93 if ($this->preconditions !== []) {
94 $objective = new ObjectiveWithPreconditions(
95 $objective,
96 ...$this->preconditions
97 );
98 }
99
100 $environment = new ArrayEnvironment([
102 ]);
103 if ($config !== null) {
104 $environment = $this->addAgentConfigsToEnvironment($agent, $config, $environment);
105 }
106
107 try {
108 $this->achieveObjective($objective, $environment, $io);
109 $io->success("Update complete. Thanks and have fun!");
110 } catch (NoConfirmationException $e) {
111 $io->error("Aborting Update, a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
112 }
113
114 return 0;
115 }
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:40
readAgentConfig(Agent $agent, InputInterface $input, ?string $use_config_field=null)

References 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 44 of file UpdateCommand.php.

◆ $preconditions

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

var Objective[]

Definition at line 49 of file UpdateCommand.php.

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


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