13use Symfony\Component\Console\Command\Command;
14use Symfony\Component\Console\Input\InputInterface;
15use Symfony\Component\Console\Output\OutputInterface;
16use Symfony\Component\Console\Input\InputArgument;
17use Symfony\Component\Console\Input\InputOption;
41 $this->agent_finder = $agent_finder;
42 $this->config_reader = $config_reader;
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.");
55 public function execute(InputInterface $input, OutputInterface $output)
59 if(!defined(
'ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES')) {
60 define(
"ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES",
true);
63 if ($input->hasOption(
'plugin') && $input->getOption(
'plugin') !=
"") {
70 $this->achieveObjective($objective, $environment, $io);
71 $io->success(
"Installation complete. Thanks and have fun!");
73 $io->error(
"Aborting Installation, a necessary confirmation is missing:\n\n" .
$e->getRequestedConfirmation());
81 $io->printLicenseMessage();
82 $io->title(
"Install ILIAS");
89 "Install and Update ILIAS",
91 $agent->getInstallObjective(
$config),
92 $agent->getUpdateObjective(
$config)
94 if (count($this->preconditions) > 0) {
97 ...$this->preconditions
109 $common_config =
$config->getConfig(
"common");
110 $environment = $environment->withResource(
112 $common_config->getClientId()
115 return [$objective, $environment, $io];
121 $io->printLicenseMessage();
122 $io->title(
"Install ILIAS Plugin");
129 "Install and Update ILIAS Plugin",
131 $agent->getInstallObjective(
$config),
132 $agent->getUpdateObjective(
$config)
134 if (count($this->preconditions) > 0) {
137 ...$this->preconditions
149 return [$objective, $environment, $io];
An exception for terminatinating execution or to throw for unit testing.
Read a json-formatted config from a file and overwrite some fields.
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
__construct(AgentFinder $agent_finder, ConfigReader $config_reader, array $preconditions)
execute(InputInterface $input, OutputInterface $output)
$preconditions
var Objective[]
preparePluginInstallation(InputInterface $input, OutputInterface $output)
prepareILIASInstallation(InputInterface $input, OutputInterface $output)
Signals that a necessary confirmation from the admin is missing.
A objective collection is a objective that is achieved once all subobjectives are achieved.
A wrapper around an objective that adds some preconditions.
An environment holds resources to be used in the setup process.
const RESOURCE_ADMIN_INTERACTION
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
trait HasAgent
Add this to an Command that has an agent.
getRelevantAgent(InputInterface $input)
readAgentConfig(Agent $agent, InputInterface $input)
trait HasConfigReader
Add this to an Command that has an config reader.
configureCommandForPlugins()