ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Setup\CLI\InstallCommand Class Reference

Installation command. More...

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

Public Member Functions

 __construct (AgentFinder $agent_finder, ConfigReader $config_reader, array $preconditions)
 

Protected Member Functions

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

Protected Attributes

array $preconditions = []
 var Objective[] More...
 

Static Protected Attributes

static $defaultName = "install"
 

Detailed Description

Installation command.

Definition at line 39 of file InstallCommand.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 55 of file InstallCommand.php.

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

56  {
58  $this->agent_finder = $agent_finder;
59  $this->config_reader = $config_reader;
60  $this->preconditions = $preconditions;
61  }
array $preconditions
var Objective[]
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ configure()

ILIAS\Setup\CLI\InstallCommand::configure ( )
protected

Definition at line 63 of file InstallCommand.php.

References ILIAS\Setup\CLI\configureCommandForPlugins().

63  : void
64  {
65  $this->setDescription("Creates a fresh ILIAS installation based on the config");
66  $this->addArgument("config", InputArgument::OPTIONAL, "Configuration file for the installation");
67  $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\"", []);
68  $this->addOption("yes", "y", InputOption::VALUE_NONE, "Confirm every message of the installation.");
70  }
configureCommandForPlugins()
Definition: HasAgent.php:33
+ Here is the call graph for this function:

◆ execute()

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

Definition at line 72 of file InstallCommand.php.

References Vendor\Package\$e, ILIAS\Setup\NoConfirmationException\getRequestedConfirmation(), ILIAS\Setup\CLI\InstallCommand\prepareILIASInstallation(), and ILIAS\Setup\CLI\InstallCommand\preparePluginInstallation().

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 (!defined("ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES")) {
77  define("ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES", true);
78  }
79 
80  if ($input->hasOption('plugin') && $input->getOption('plugin') != "") {
81  list($objective, $environment, $io) = $this->preparePluginInstallation($input, $output);
82  } else {
83  list($objective, $environment, $io) = $this->prepareILIASInstallation($input, $output);
84  }
85 
86  try {
87  $this->achieveObjective($objective, $environment, $io);
88  $io->success("Installation complete. Thanks and have fun!");
89  } catch (NoConfirmationException $e) {
90  $io->error("Aborting Installation, a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
91  }
92 
93  return 0;
94  }
prepareILIASInstallation(InputInterface $input, OutputInterface $output)
preparePluginInstallation(InputInterface $input, OutputInterface $output)
+ Here is the call graph for this function:

◆ prepareILIASInstallation()

ILIAS\Setup\CLI\InstallCommand::prepareILIASInstallation ( InputInterface  $input,
OutputInterface  $output 
)
protected

Definition at line 96 of file InstallCommand.php.

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

Referenced by ILIAS\Setup\CLI\InstallCommand\execute().

96  : array
97  {
98  $io = new IOWrapper($input, $output);
99  $io->printLicenseMessage();
100  $io->title("Install ILIAS");
101 
102  $agent = $this->getRelevantAgent($input);
103 
104  $config = $this->readAgentConfig($agent, $input);
105 
106  $objective = new ObjectiveCollection(
107  "Install and Update ILIAS",
108  false,
109  $agent->getInstallObjective($config),
110  $agent->getUpdateObjective($config)
111  );
112  if ($this->preconditions !== []) {
113  $objective = new ObjectiveWithPreconditions(
114  $objective,
115  ...$this->preconditions
116  );
117  }
118 
119  $environment = new ArrayEnvironment([
121  ]);
122  $environment = $this->addAgentConfigsToEnvironment($agent, $config, $environment);
123  // ATTENTION: This is bad because we strongly couple this generic command
124  // to something very specific here. This can go away once we have got rid of
125  // everything related to clients, since we do not need that client-id then.
126  // This will require some more work, though.
127  $common_config = $config->getConfig("common");
128  $environment = $environment->withResource(
130  $common_config->getClientId()
131  );
132 
133  return [$objective, $environment, $io];
134  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:40
readAgentConfig(Agent $agent, InputInterface $input, string $use_config_field=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preparePluginInstallation()

ILIAS\Setup\CLI\InstallCommand::preparePluginInstallation ( InputInterface  $input,
OutputInterface  $output 
)
protected

Definition at line 136 of file InstallCommand.php.

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

Referenced by ILIAS\Setup\CLI\InstallCommand\execute().

136  : array
137  {
138  $io = new IOWrapper($input, $output);
139  $io->printLicenseMessage();
140  $io->title("Install ILIAS Plugin");
141 
142  $agent = $this->getRelevantAgent($input);
143 
144  $config = $this->readAgentConfig($agent, $input, $input->getOption("plugin"));
145 
146  $objective = new ObjectiveCollection(
147  "Install and Update ILIAS Plugin",
148  false,
149  $agent->getInstallObjective($config),
150  $agent->getUpdateObjective($config)
151  );
152  if ($this->preconditions !== []) {
153  $objective = new ObjectiveWithPreconditions(
154  $objective,
155  ...$this->preconditions
156  );
157  }
158 
159  $environment = new ArrayEnvironment([
161  ]);
162 
163  if (!is_null($config)) {
164  $environment = $this->addAgentConfigsToEnvironment($agent, $config, $environment);
165  }
166 
167  return [$objective, $environment, $io];
168  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:40
readAgentConfig(Agent $agent, InputInterface $input, string $use_config_field=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $defaultName

ILIAS\Setup\CLI\InstallCommand::$defaultName = "install"
staticprotected

Definition at line 45 of file InstallCommand.php.

◆ $preconditions

array ILIAS\Setup\CLI\InstallCommand::$preconditions = []
protected

var Objective[]

Definition at line 50 of file InstallCommand.php.

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


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