ILIAS  release_7 Revision v7.30-3-g800a261c036
BuildArtifactsCommand.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4namespace ILIAS\Setup\CLI;
5
11use Symfony\Component\Console\Command\Command;
12use Symfony\Component\Console\Input\InputInterface;
13use Symfony\Component\Console\Output\OutputInterface;
14use Symfony\Component\Console\Input\InputOption;
15
19class BuildArtifactsCommand extends Command
20{
21 use HasAgent;
22 use ObjectiveHelper;
23
24 protected static $defaultName = "build-artifacts";
25
26 public function __construct(AgentFinder $agent_finder)
27 {
29 $this->agent_finder = $agent_finder;
30 }
31
32 public function configure()
33 {
34 $this->setDescription("Build static artifacts from source");
35 $this->addOption("yes", "y", InputOption::VALUE_NONE, "Confirm every message of the setup.");
37 }
38
39 public function execute(InputInterface $input, OutputInterface $output)
40 {
41 $io = new IOWrapper($input, $output);
42 $io->printLicenseMessage();
43 $io->title("Building Static Artifacts for ILIAS");
44
45 $agent = $this->getRelevantAgent($input);
46
47 $objective = $agent->getBuildArtifactObjective();
48
49 $environment = new ArrayEnvironment([
51 ]);
52
53 try {
54 $this->achieveObjective($objective, $environment, $io);
55 $io->success("All static artifacts are build!");
56 } catch (NoConfirmationException $e) {
57 $io->error("Aborting Installation, a necessary confirmation is missing:\n\n" . $e->getRequestedConfirmation());
58 }
59 }
60}
An exception for terminatinating execution or to throw for unit testing.
execute(InputInterface $input, OutputInterface $output)
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Definition: IOWrapper.php:17
Signals that a necessary confirmation from the admin is missing.
An environment holds resources to be used in the setup process.
Definition: Environment.php:12
__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:15
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:28
configureCommandForPlugins()
Definition: HasAgent.php:21