CliApplication
class CliApplication extends BaseApplication
Base class for a Joomla! command line application.
Methods
Class constructor.
Registers a handler to a particular event group.
Calls all handlers associated with an event group.
Allows the application to load a custom or default dispatcher.
Allows the application to load a custom or default identity.
Returns a reference to the global CliApplication object, only creating it if it doesn't already exist.
Execute the application.
Load an object or array into the application configuration object.
Write a string to standard output.
Get an output object.
Set an output object.
Get a value from standard input.
Details
__construct(
Input $input = null,
Registry $config = null,
JEventDispatcher $dispatcher = null)
Class constructor.
BaseApplication
registerEvent(
string $event,
callable $handler)
Registers a handler to a particular event group.
array
triggerEvent(
string $event,
array $args = null)
Calls all handlers associated with an event group.
BaseApplication
loadDispatcher(
JEventDispatcher $dispatcher = null)
Allows the application to load a custom or default dispatcher.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create event dispatchers, if required, based on more specific needs.
BaseApplication
loadIdentity(
JUser $identity = null)
Allows the application to load a custom or default identity.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create an identity, if required, based on more specific needs.
static
CliApplication
getInstance(
string $name = null)
Returns a reference to the global CliApplication object, only creating it if it doesn't already exist.
This method must be invoked as: $cli = CliApplication::getInstance();
CliApplication
loadConfiguration(
mixed $data)
Load an object or array into the application configuration object.