CodeIgniter v4.6 API

Commands
in package

Core functionality for running, listing, etc commands.

Tags
phpstan-type

commands_list array<string, array{'class': class-string<BaseCommand>, 'file': string, 'group': string,'description': string}>

Table of Contents

Properties

$commands  : commands_list
The found commands.
$logger  : Logger
Logger instance.

Methods

__construct()  : mixed
Constructor
discoverCommands()  : void
Discovers all commands in the framework and within user code, and collects instances of them to work with.
getCommands()  : commands_list
Provide access to the list of commands.
run()  : int
Runs a command given
verifyCommand()  : bool
Verifies if the command being sought is found in the commands list.
getCommandAlternatives()  : array<int, string>
Finds alternative of `$name` among collection of commands.

Properties

$commands

The found commands.

protected commands_list $commands = []

Methods

__construct()

Constructor

public __construct([Logger|null $logger = null ]) : mixed
Parameters
$logger : Logger|null = null

discoverCommands()

Discovers all commands in the framework and within user code, and collects instances of them to work with.

public discoverCommands() : void

getCommands()

Provide access to the list of commands.

public getCommands() : commands_list
Return values
commands_list

run()

Runs a command given

public run(string $command, array<int|string, string|null> $params) : int
Parameters
$command : string
$params : array<int|string, string|null>
Return values
int

Exit code

verifyCommand()

Verifies if the command being sought is found in the commands list.

public verifyCommand(string $command, commands_list $commands) : bool
Parameters
$command : string
$commands : commands_list
Return values
bool

getCommandAlternatives()

Finds alternative of `$name` among collection of commands.

protected getCommandAlternatives(string $name, commands_list $collection) : array<int, string>
Parameters
$name : string
$collection : commands_list
Return values
array<int, string>

        
On this page

Search results