48 CliApplication $console,
53 $this->console = $console;
54 $this->hooks = $hooks;
64 $commands = $this->hooks->trigger(
'commands',
'cli', null, []);
66 foreach ($commands as $command) {
79 public function add($command) {
80 if (!class_exists($command)) {
88 $command =
new $command();
92 $command->setLogger($this->logger);
95 $command->addOption(
'as',
'u', InputOption::VALUE_OPTIONAL,
96 'Execute the command on behalf of a user with the given username' 99 $this->console->add($command);
110 $this->console->run($this->input, $this->output);
getOutput()
Returns console output.
__construct(CliApplication $console, PluginHooksService $hooks, InputInterface $input, OutputInterface $output)
Constructor.
trait Loggable
Enables adding a logger.
Wrapper for console application.
catch(LoginException $e) if($request->isXhr()) $output
run()
Bootstrap and run console application.
getInput()
Returns console input.
add($command)
Add a new CLI command.
bootstrap()
Add CLI tools to the console application.