CodeIgniter v4.5 API

Commands
in package

Core functionality for running, listing, etc commands.

Table of Contents

Properties

$commands  : array<string|int, mixed>
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()  : array<string|int, mixed>
Provide access to the list of commands.
run()  : int|void
Runs a command given
verifyCommand()  : bool
Verifies if the command being sought is found in the commands list.
getCommandAlternatives()  : array<string|int, mixed>
Finds alternative of `$name` among collection of commands.

Properties

$commands

The found commands.

protected array<string|int, mixed> $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() : array<string|int, mixed>
Return values
array<string|int, mixed>

run()

Runs a command given

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

Exit code

verifyCommand()

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

public verifyCommand(string $command, array<string|int, mixed> $commands) : bool
Parameters
$command : string
$commands : array<string|int, mixed>
Return values
bool

getCommandAlternatives()

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

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

        
On this page

Search results