ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Setup\CLI Namespace Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

Data Structures

class  AchieveCommand
 Achieves an objective. More...
 
class  App
 The ILIAS-setup-console-application. More...
 
class  BuildArtifactsCommand
 Installation command. More...
 
class  ConfigReader
 Read a json-formatted config from a file and overwrite some fields. More...
 
class  InstallCommand
 Installation command. More...
 
class  IOWrapper
 Wrapper around symfonies input and output facilities to provide just the functionality required for the ILIAS-setup. More...
 
class  MigrateCommand
 Migration command. More...
 
class  StatusCommand
 Command to output status information about the installation. More...
 
class  UpdateCommand
 Update command. More...
 

Functions

 configureCommandForPlugins ()
 
 getRelevantAgent (InputInterface $input)
 
 readAgentConfig (Agent $agent, InputInterface $input)
 
 addAgentConfigsToEnvironment (Agent $agent, Config $config, Environment $environment)
 

Variables

trait HasAgent
 Add this to an Command that has an agent. More...
 
trait HasConfigReader
 Add this to an Command that has an config reader. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Function Documentation

◆ addAgentConfigsToEnvironment()

ILIAS\Setup\CLI\addAgentConfigsToEnvironment ( Agent  $agent,
Config  $config,
Environment  $environment 
)
protected

Definition at line 49 of file HasConfigReader.php.

References ILIAS\Setup\Environment\withConfigFor().

Referenced by ILIAS\Setup\CLI\UpdateCommand\execute(), ILIAS\Setup\CLI\AchieveCommand\execute(), ILIAS\Setup\CLI\InstallCommand\prepareILIASInstallation(), and ILIAS\Setup\CLI\InstallCommand\preparePluginInstallation().

53  : Environment {
54  if ($agent instanceof AgentCollection) {
55  foreach ($config->getKeys() as $k) {
56  $environment = $environment->withConfigFor($k, $config->getConfig($k));
57  }
58  }
59 
60  return $environment;
61  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ configureCommandForPlugins()

ILIAS\Setup\CLI\configureCommandForPlugins ( )
protected

Definition at line 21 of file HasAgent.php.

Referenced by ILIAS\Setup\CLI\StatusCommand\configure(), ILIAS\Setup\CLI\BuildArtifactsCommand\configure(), ILIAS\Setup\CLI\MigrateCommand\configure(), ILIAS\Setup\CLI\InstallCommand\configure(), and ILIAS\Setup\CLI\UpdateCommand\configure().

22  {
23  $this->addOption("plugin", null, InputOption::VALUE_REQUIRED, "Name of the plugin to run the command for.");
24  $this->addOption("no-plugins", null, InputOption::VALUE_NONE, "Ignore all plugins when running the command.");
25  $this->addOption("skip", null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, "Skip plugin with the supplied <plugin-name> when running the command.");
26  }
+ Here is the caller graph for this function:

◆ getRelevantAgent()

ILIAS\Setup\CLI\getRelevantAgent ( InputInterface  $input)
protected

Definition at line 28 of file HasAgent.php.

Referenced by ILIAS\Setup\CLI\StatusCommand\execute(), ILIAS\Setup\CLI\BuildArtifactsCommand\execute(), ILIAS\Setup\CLI\UpdateCommand\execute(), ILIAS\Setup\CLI\AchieveCommand\execute(), ILIAS\Setup\CLI\MigrateCommand\listMigrations(), ILIAS\Setup\CLI\InstallCommand\prepareILIASInstallation(), ILIAS\Setup\CLI\InstallCommand\preparePluginInstallation(), ILIAS\Setup\CLI\MigrateCommand\runMigration(), and ILIAS\Tests\Setup\CLI\HasAgentTest\setUp().

28  : Agent
29  {
30  if (!$this->agent_finder) {
31  throw new \LogicException(
32  "\$this->agent_finder needs to intialized with an AgentFinder."
33  );
34  }
35 
36  if ($input->hasOption("no-plugins") && $input->getOption("no-plugins")) {
37  // The agents of the core are in all folders but the customizing folder.
38  return $this->agent_finder->getCoreAgents();
39  }
40 
41  if ($input->hasOption("plugin")) {
42  $plugin_name = $input->getOption("plugin");
43  if ($plugin_name) {
44  return $this->agent_finder->getPluginAgent($plugin_name);
45  }
46  }
47 
48  $agents = $this->agent_finder->getAgents();
49  if ($input->hasOption("skip")) {
50  foreach (($input->getOption("skip") ?? []) as $plugin_name) {
51  $agents = $agents->withRemovedAgent(strtolower($plugin_name));
52  }
53  }
54 
55  return $agents;
56  }
+ Here is the caller graph for this function:

◆ readAgentConfig()

ILIAS\Setup\CLI\readAgentConfig ( Agent  $agent,
InputInterface  $input 
)
protected

Definition at line 22 of file HasConfigReader.php.

References ILIAS\Setup\Agent\getArrayToConfigTransformation(), and ILIAS\Setup\Agent\hasConfig().

Referenced by ILIAS\Setup\CLI\UpdateCommand\execute(), ILIAS\Setup\CLI\AchieveCommand\execute(), ILIAS\Setup\CLI\InstallCommand\prepareILIASInstallation(), ILIAS\Setup\CLI\InstallCommand\preparePluginInstallation(), and ILIAS\Tests\Setup\CLI\HasConfigReaderTest\setUp().

22  : ?Config
23  {
24  if (!($this->config_reader instanceof ConfigReader)) {
25  throw new \LogicException("\$this->config_reader not properly initialized.");
26  }
27 
28  if (!$agent->hasConfig()) {
29  return null;
30  }
31 
32  $config_file = $input->getArgument("config");
33  $config_overwrites_raw = $input->getOption("config");
34  $config_overwrites = [];
35  foreach ($config_overwrites_raw as $o) {
36  $vs = explode("=", $o);
37  if (count($vs) !== 2) {
38  throw new \Exception("Cannot read config-option: '$o'");
39  }
40  $config_overwrites[$vs[0]] = $vs[1];
41  }
42 
43  $config_content = $this->config_reader->readConfigFile($config_file, $config_overwrites);
44 
45  $trafo = $agent->getArrayToConfigTransformation();
46  return $trafo->transform($config_content);
47  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ HasAgent

trait ILIAS::Setup::CLI\HasAgent
Initial value:
{
protected $agent_finder = null

Add this to an Command that has an agent.

Definition at line 15 of file HasAgent.php.

Referenced by ILIAS\Tests\Setup\CLI\HasAgentTest\setUp().

◆ HasConfigReader

trait ILIAS::Setup::CLI\HasConfigReader
Initial value:
{
protected $config_reader

Add this to an Command that has an config reader.

Definition at line 16 of file HasConfigReader.php.

Referenced by ILIAS\Tests\Setup\CLI\HasConfigReaderTest\setUp().