ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 
 configure ()
 
 execute (InputInterface $input, OutputInterface $output)
 

Protected Member Functions

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

Protected Attributes

 $preconditions
 var Objective[] More...
 

Static Protected Attributes

static $defaultName = "install"
 

Detailed Description

Installation command.

Definition at line 22 of file InstallCommand.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 38 of file InstallCommand.php.

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

39  {
41  $this->agent_finder = $agent_finder;
42  $this->config_reader = $config_reader;
43  $this->preconditions = $preconditions;
44  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ configure()

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

Definition at line 46 of file InstallCommand.php.

References ILIAS\Setup\CLI\configureCommandForPlugins().

47  {
48  $this->setDescription("Creates a fresh ILIAS installation based on the config");
49  $this->addArgument("config", InputArgument::OPTIONAL, "Configuration file for the installation");
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("yes", "y", InputOption::VALUE_NONE, "Confirm every message of the installation.");
53  }
configureCommandForPlugins()
Definition: HasAgent.php:21
+ Here is the call graph for this function:

◆ execute()

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

Definition at line 55 of file InstallCommand.php.

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

56  {
57  // ATTENTION: This is a hack to get around the usage of the echo/exit pattern in
58  // the setup for the command line version of the setup. Do not use this.
59  if(!defined('ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES')) {
60  define("ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES", true);
61  }
62 
63  if ($input->hasOption('plugin') && $input->getOption('plugin') != "") {
64  list($objective, $environment, $io) = $this->preparePluginInstallation($input, $output);
65  } else {
66  list($objective, $environment, $io) = $this->prepareILIASInstallation($input, $output);
67  }
68 
69  try {
70  $this->achieveObjective($objective, $environment, $io);
71  $io->success("Installation complete. Thanks and have fun!");
72  } catch (NoConfirmationException $e) {
73  $io->error("Aborting Installation, a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
74  }
75 
76  }
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 78 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().

78  : array
79  {
80  $io = new IOWrapper($input, $output);
81  $io->printLicenseMessage();
82  $io->title("Install ILIAS");
83 
84  $agent = $this->getRelevantAgent($input);
85 
86  $config = $this->readAgentConfig($agent, $input);
87 
88  $objective = new ObjectiveCollection(
89  "Install and Update ILIAS",
90  false,
91  $agent->getInstallObjective($config),
92  $agent->getUpdateObjective($config)
93  );
94  if (count($this->preconditions) > 0) {
95  $objective = new ObjectiveWithPreconditions(
96  $objective,
97  ...$this->preconditions
98  );
99  }
100 
101  $environment = new ArrayEnvironment([
103  ]);
104  $environment = $this->addAgentConfigsToEnvironment($agent, $config, $environment);
105  // ATTENTION: This is bad because we strongly couple this generic command
106  // to something very specific here. This can go away once we have got rid of
107  // everything related to clients, since we do not need that client-id then.
108  // This will require some more work, though.
109  $common_config = $config->getConfig("common");
110  $environment = $environment->withResource(
112  $common_config->getClientId()
113  );
114 
115  return [$objective, $environment, $io];
116  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
readAgentConfig(Agent $agent, InputInterface $input)
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:28
+ 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 118 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().

118  : array
119  {
120  $io = new IOWrapper($input, $output);
121  $io->printLicenseMessage();
122  $io->title("Install ILIAS Plugin");
123 
124  $agent = $this->getRelevantAgent($input);
125 
126  $config = $this->readAgentConfig($agent, $input);
127 
128  $objective = new ObjectiveCollection(
129  "Install and Update ILIAS Plugin",
130  false,
131  $agent->getInstallObjective($config),
132  $agent->getUpdateObjective($config)
133  );
134  if (count($this->preconditions) > 0) {
135  $objective = new ObjectiveWithPreconditions(
136  $objective,
137  ...$this->preconditions
138  );
139  }
140 
141  $environment = new ArrayEnvironment([
143  ]);
144 
145  if (!is_null($config)) {
146  $environment = $this->addAgentConfigsToEnvironment($agent, $config, $environment);
147  }
148 
149  return [$objective, $environment, $io];
150  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
readAgentConfig(Agent $agent, InputInterface $input)
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:28
+ 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 28 of file InstallCommand.php.

◆ $preconditions

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

var Objective[]

Definition at line 33 of file InstallCommand.php.

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


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