ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
4 namespace ILIAS\Setup\CLI;
5 
15 
19 class 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 }
execute(InputInterface $input, OutputInterface $output)
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Definition: IOWrapper.php:16
getRelevantAgent(InputInterface $input)
Definition: HasAgent.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
configureCommandForPlugins()
Definition: HasAgent.php:21
__construct(Container $dic, ilPlugin $plugin)
trait HasAgent
Add this to an Command that has an agent.
Definition: HasAgent.php:15
Signals that a necessary confirmation from the admin is missing.