Achieves an objective.
More...
Achieves an objective.
Definition at line 41 of file AchieveCommand.php.
◆ __construct()
ILIAS\Setup\CLI\AchieveCommand::__construct |
( |
AgentFinder |
$agent_finder, |
|
|
ConfigReader |
$config_reader, |
|
|
array |
$preconditions, |
|
|
Refinery |
$refinery |
|
) |
| |
◆ configure()
ILIAS\Setup\CLI\AchieveCommand::configure |
( |
| ) |
|
|
protected |
Definition at line 69 of file AchieveCommand.php.
71 $this->setDescription(
"Achieve a named objective from an agent.");
74 InputArgument::OPTIONAL,
75 "Objective to be execute from an agent. Format: \$AGENT::\$OBJECTIVE" 77 $this->addArgument(
"config", InputArgument::OPTIONAL,
"Configuration file for the installation");
81 InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
82 "Define fields in the configuration file that should be overwritten, e.g. \"a.b.c=foo\"",
85 $this->addOption(
"yes",
"y", InputOption::VALUE_NONE,
"Confirm every message of the objective.");
86 $this->addOption(
"list", null, InputOption::VALUE_NONE,
"Lists all achievable objectives");
◆ execute()
ILIAS\Setup\CLI\AchieveCommand::execute |
( |
InputInterface |
$input, |
|
|
OutputInterface |
$output |
|
) |
| |
|
protected |
◆ executeAchieveObjective()
ILIAS\Setup\CLI\AchieveCommand::executeAchieveObjective |
( |
IOWrapper |
$io, |
|
|
InputInterface |
$input |
|
) |
| |
|
private |
Definition at line 131 of file AchieveCommand.php.
References $config, Vendor\Package\$e, ILIAS\Setup\CLI\addAgentConfigsToEnvironment(), ILIAS\Setup\CLI\IOWrapper\error(), ILIAS\Setup\CLI\getRelevantAgent(), ILIAS\Setup\NoConfirmationException\getRequestedConfirmation(), ILIAS\Setup\CLI\readAgentConfig(), ILIAS\Setup\Environment\RESOURCE_ADMIN_INTERACTION, ILIAS\Setup\CLI\IOWrapper\success(), and ILIAS\Setup\CLI\IOWrapper\title().
Referenced by ILIAS\Setup\CLI\AchieveCommand\execute().
134 $objective_name = $input->getArgument(
'objective');
136 $io->title(
"Achieve objective: $objective_name");
140 if ($input->getArgument(
"config")) {
144 $namedObjectives = $agent->getNamedObjectives(
$config);
146 if (isset($namedObjectives[$objective_name])) {
147 $objective = $namedObjectives[$objective_name];
150 "There is no named objective '$objective_name'" 154 if ($this->preconditions !== []) {
155 $objective =
new ObjectiveWithPreconditions(
156 $objective->create(),
157 ...$this->preconditions
160 $objective = $objective->create();
163 $environment =
new ArrayEnvironment([
171 $this->achieveObjective($objective, $environment, $io);
172 $io->success(
"Achieved objective '$objective_name'. Thanks and have fun!");
173 }
catch (NoConfirmationException
$e) {
174 $io->error(
"Aborted the attempt to achieve '$objective_name', a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
addAgentConfigsToEnvironment(Agent $agent, Config $config, Environment $environment)
getRelevantAgent(InputInterface $input)
readAgentConfig(Agent $agent, InputInterface $input, string $use_config_field=null)
const RESOURCE_ADMIN_INTERACTION
◆ executeListNamedObjectives()
ILIAS\Setup\CLI\AchieveCommand::executeListNamedObjectives |
( |
IOWrapper |
$io, |
|
|
OutputInterface |
$output |
|
) |
| |
|
private |
◆ shouldListNamedObjectives()
ILIAS\Setup\CLI\AchieveCommand::shouldListNamedObjectives |
( |
InputInterface |
$input | ) |
|
|
private |
Definition at line 104 of file AchieveCommand.php.
Referenced by ILIAS\Setup\CLI\AchieveCommand\execute().
108 $input->getOption(
"list") !== null
109 && is_bool($input->getOption(
"list"))
110 && $input->getOption(
"list")
114 $input->getArgument(
"objective") ===
"" 115 || $input->getArgument(
"objective") === null
◆ $defaultName
ILIAS\Setup\CLI\AchieveCommand::$defaultName = "achieve" |
|
staticprotected |
◆ $preconditions
array ILIAS\Setup\CLI\AchieveCommand::$preconditions = [] |
|
protected |
◆ $refinery
Refinery ILIAS\Setup\CLI\AchieveCommand::$refinery |
|
protected |
The documentation for this class was generated from the following file: