ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
BuildCommand.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Setup\CLI;
22
29use Symfony\Component\Console\Input\InputInterface;
30use Symfony\Component\Console\Output\OutputInterface;
31use Symfony\Component\Console\Input\InputOption;
32
36class BuildCommand extends Command
37{
38 use HasAgent;
39 use ObjectiveHelper;
40
41 protected static $defaultName = "build";
42
43 public function __construct(AgentFinder $agent_finder)
44 {
46 $this->agent_finder = $agent_finder;
47 }
48
49 protected function configure(): void
50 {
51 $this->setDescription("Build static artifacts from source");
52 $this->addOption("yes", "y", InputOption::VALUE_NONE, "Confirm every message of the setup.");
54 }
55
56 protected function execute(InputInterface $input, OutputInterface $output): int
57 {
58 $io = new IOWrapper($input, $output);
59 $io->printLicenseMessage();
60 $io->title("Building Static Artifacts for ILIAS");
61
62 $agent = $this->getRelevantAgent($input);
63
64 $objective = $agent->getBuildObjective();
65
66 $environment = new ArrayEnvironment([
68 ]);
69
70 try {
71 $this->achieveObjective($objective, $environment, $io);
72 $io->success("All static artifacts are build!");
73 } catch (NoConfirmationException $e) {
74 $io->error("Aborting Installation, a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
75 }
76
77 return 0;
78 }
79}
Installation command.
__construct(AgentFinder $agent_finder)
execute(InputInterface $input, OutputInterface $output)
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Definition: IOWrapper.php:33
Signals that a necessary confirmation from the admin is missing.
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
trait HasAgent
Add this to an Command that has an agent.
Definition: HasAgent.php:30
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:40
configureCommandForPlugins()
Definition: HasAgent.php:33