\CodeIgniter\CLIBaseCommand

Class BaseCommand

Summary

Methods
Properties
Constants
__construct()
run()
__get()
__isset()
showHelp()
getPad()
$group
$name
$description
No constants found
call()
showError()
$group
$name
$usage
$description
$options
$arguments
$logger
$commands
N/A
No private methods found
No private properties found
N/A

Properties

$group

$group : 

Type

$name

$name : 

Type

$description

$description : 

Type

$group

$group : string

The group the command is lumped under when listing commands.

Type

string

$name

$name : string

The Command's name

Type

string

$usage

$usage : string

the Command's usage description

Type

string

$description

$description : string

the Command's short description

Type

string

$options

$options : array

the Command's options description

Type

array

$arguments

$arguments : array

the Command's Arguments description

Type

array

$commands

$commands : \CodeIgniter\CLI\CommandRunner

Instance of the CommandRunner controller so commands can call other commands.

Type

\CodeIgniter\CLI\CommandRunner

Methods

run()

run(array  $params) 

Actually execute a command.

This has to be over-ridden in any concrete implementation.

Parameters

array $params

__get()

__get(string  $key) : mixed

Makes it simple to access our protected properties.

Parameters

string $key

Returns

mixed

__isset()

__isset(string  $key) : boolean

Makes it simple to check our protected properties.

Parameters

string $key

Returns

boolean

showHelp()

showHelp() 

show Help include (usage,arguments,description,options)

getPad()

getPad(array  $array, integer  $pad) : integer

Get pad for $key => $value array output

Parameters

array $array
integer $pad

Returns

integer

call()

call(string  $command, array  $params = array()) : mixed

Can be used by a command to run other commands.

Parameters

string $command
array $params

Throws

\ReflectionException

Returns

mixed

showError()

showError(\Exception  $e) 

A simple method to display an error with line/file, in child commands.

Parameters

\Exception $e