Application
in package
Console application
Table of Contents
Constants
- LOG_ERROR_MESSAGE = 'Error command execution.'
- LOG_MESSAGE = 'Command executed.'
- LOG_TERMINATE_MESSAGE = 'Console command terminated.'
Properties
- $application : Application
- App object
- $dispatcher : EventDispatcher
- Event dispatcher
- $logger : LoggerInterface|null
- Logger
- $options : array<string|int, mixed>
- Options
- $title : string
- Console app title
- $version : string
- App version
Methods
- __construct() : mixed
- Constructor
- addCommands() : void
- Add commands to console app
- getDispatcher() : EventDispatcher
- Get event dispatcher
- run() : void
- Run console cli
- log() : bool
- Log message
- logError() : bool
- Log error message
Constants
LOG_ERROR_MESSAGE
public
mixed
LOG_ERROR_MESSAGE
= 'Error command execution.'
LOG_MESSAGE
public
mixed
LOG_MESSAGE
= 'Command executed.'
LOG_TERMINATE_MESSAGE
public
mixed
LOG_TERMINATE_MESSAGE
= 'Console command terminated.'
Properties
$application
App object
protected
Application
$application
$dispatcher
Event dispatcher
protected
EventDispatcher
$dispatcher
$logger
Logger
protected
LoggerInterface|null
$logger
= null
$options
Options
protected
array<string|int, mixed>
$options
= []
$title
Console app title
protected
string
$title
$version
App version
protected
string
$version
Methods
__construct()
Constructor
public
__construct(string $title[, string $version = '' ][, array<string|int, mixed> $options = [] ][, LoggerInterface|null $logger = null ]) : mixed
Parameters
- $title : string
- $version : string = ''
- $options : array<string|int, mixed> = []
- $logger : LoggerInterface|null = null
addCommands()
Add commands to console app
public
addCommands(array<string|int, mixed> $commands) : void
Parameters
- $commands : array<string|int, mixed>
getDispatcher()
Get event dispatcher
public
getDispatcher() : EventDispatcher
Return values
EventDispatcherrun()
Run console cli
public
run() : void
log()
Log message
protected
log(string $message[, array<string|int, mixed> $context = [] ]) : bool
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
boollogError()
Log error message
protected
logError(string $message[, array<string|int, mixed> $context = [] ]) : bool
Parameters
- $message : string
- $context : array<string|int, mixed> = []