AbstractCliApplication
Extends AbstractApplicationBase class for a Joomla! command line application.
| since |
1.0 |
|---|---|
| deprecated |
2.0 Use the |
| package |
Joomla Framework |
Methods
__construct
Class constructor.
__construct(\Joomla\Input\Input input = null, \Joomla\Registry\Registry config = null) : mixed
| since |
1.0 |
|---|
Arguments
- input
\Joomla\Input\InputAn optional argument to provide dependency injection for the application's input object. If the argument is an Input object that object will become the application's input object, otherwise a default input object is created.- config
\Joomla\Registry\RegistryAn optional argument to provide dependency injection for the application's config object. If the argument is a Registry object that object will become the application's config object, otherwise a default config object is created.
Response
mixed
close
Method to close the application.
close(int code) : void
| since |
1.0 |
|---|
Arguments
- code
intThe exit code (optional; default is 0).
doExecute
Method to run the application routines. Most likely you will want to instantiate a controller and execute it, or perform some sort of task directly.
doExecute() : mixed
| since |
1.0 |
|---|
Response
mixed
execute
Execute the application.
execute() : void
| since |
1.0 |
|---|
get
Returns a property of the object or the default value if the property is not set.
get(string key, mixed default = null) : mixed
| since |
1.0 |
|---|
Arguments
- key
stringThe name of the property.- default
mixedThe default value (optional) if none is set.
Response
mixedThe value of the configuration.
getCliInput
Get a CLI input object.
getCliInput() : \Joomla\Application\Cli\CliInput
| since |
1.6.0 |
|---|
Response
\Joomla\Application\Cli\CliInput
getLogger
Get the logger.
getLogger() : \Psr\Log\LoggerInterface
| since |
1.0 |
|---|
Response
\Psr\Log\LoggerInterface
getOutput
Get an output object.
getOutput() : \Joomla\Application\Cli\CliOutput
| since |
1.0 |
|---|
Response
\Joomla\Application\Cli\CliOutput
in
Get a value from standard input.
in() : string
| since |
1.0 |
|---|
Response
stringThe input string from standard input.
initialise
Custom initialisation method.
initialise() : void
Called at the end of the AbstractApplication::__construct method. This is for developers to inject initialisation code for their application classes.
| since |
1.0 |
|---|
out
Write a string to standard output.
out(string text = '', bool nl = true) : \Joomla\Application\AbstractCliApplication
| since |
1.0 |
|---|
Arguments
- text
stringThe text to display.- nl
boolTrue (default) to append a new line at the end of the output string.
Response
\Joomla\Application\AbstractCliApplicationInstance of $this to allow chaining.
set
Modifies a property of the object, creating it if it does not already exist.
set(string key, mixed value = null) : mixed
| since |
1.0 |
|---|
Arguments
- key
stringThe name of the property.- value
mixedThe value of the property to set (optional).
Response
mixedPrevious value of the property
setConfiguration
Sets the configuration for the application.
setConfiguration(\Joomla\Registry\Registry config) : \Joomla\Application\AbstractApplication
| since |
1.0 |
|---|
Arguments
- config
\Joomla\Registry\RegistryA registry object holding the configuration.
Response
\Joomla\Application\AbstractApplicationReturns itself to support chaining.
setLogger
Set the logger.
setLogger(\Psr\Log\LoggerInterface logger) : \Joomla\Application\AbstractApplication
| since |
1.0 |
|---|
Arguments
- logger
\Psr\Log\LoggerInterfaceThe logger.
Response
\Joomla\Application\AbstractApplicationReturns itself to support chaining.
Properties
output
Output object
| since |
1.0 |
|---|
Type(s)
\Joomla\Application\Cli\CliOutput
cliInput
CLI Input object
| since |
1.6.0 |
|---|
Type(s)
\Joomla\Application\Cli\CliInput
config
The application configuration object.
| since |
1.0 |
|---|
Type(s)
\Joomla\Registry\Registry
input
The application input object.
| since |
1.0 |
|---|
Type(s)
\Joomla\Input\Input
logger
A logger.
| since |
1.0 |
|---|
Type(s)
\Psr\Log\LoggerInterface