34 protected InputInterface
$input,
35 protected OutputInterface
$output 38 $console->setup($input, $output);
40 $this->console = $console;
49 $commands = array_merge($this->getCoreCommands(), $this->getPluginCommands());
50 $commands = $this->events->triggerResults(
'commands',
'cli', [], $commands);
52 foreach ($commands as $command) {
64 return \Elgg\Includer::includeFile($conf);
77 $plugin_commands = $plugin->getStaticConfig(
'cli_commands', []);
78 if (empty($plugin_commands)) {
82 $return = array_merge($return, $plugin_commands);
96 public function add(
string $command):
void {
97 if (!class_exists($command)) {
101 if (!is_subclass_of($command, BaseCommand::class)) {
105 $command =
new $command();
109 if (!is_subclass_of($command, Command::class)) {
110 $this->console->add($command);
115 $command->addOption(
'as',
'u', InputOption::VALUE_OPTIONAL,
120 $command->addOption(
'language', null, InputOption::VALUE_OPTIONAL,
124 $this->console->add($command);
134 public function run(
bool $bootstrap =
true):
void {
139 $this->console->run($this->input, $this->output);
elgg_get_release()
Get the current Elgg release.
elgg_get_plugins(string $status= 'active')
Returns an ordered list of plugins.
__construct(protected EventsService $events, protected InputInterface $input, protected OutputInterface $output)
Constructor.
static elgg()
Get the Elgg codebase path with "/".
getOutput()
Returns console output.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Wrapper for console application.
trait Loggable
Enables adding a logger.
getCoreCommands()
Returns the core cli commands.
add(string $command)
Add a new CLI command.
getInput()
Returns console input.
getLogger()
Returns logger.
getPluginCommands()
Returns the cli commands registered in plugins.
run(bool $bootstrap=true)
Bootstrap and run console application.
bootstrap()
Add CLI tools to the console application.