Back to Joomla project (class list)

Class CliApplication - list of methods

Base class for a Joomla! command line application.

Extends

Direct known subclasses

Package: Joomla\CMS\Application
Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Application/CliApplication.php
Project: Joomla

Method Summary

public
(\Joomla\Input\Input $input = null, \Joomla\Registry\Registry $config = null, \Joomla\CMS\Application\CLI\CliOutput $output = null, \Joomla\CMS\Application\CLI\CliInput $cliInput = null, \Joomla\Event\DispatcherInterface $dispatcher = null, \Joomla\DI\Container $container = null)

Class constructor.
Parameters
  • \Joomla\Input\Input $input An optional argument to provide dependency injection for the application's input object. If the argument is a JInputCli object that object will become the application's input object, otherwise a default input object is created.
  • \Joomla\Registry\Registry $config An 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.
  • \Joomla\CMS\Application\CLI\CliOutput $output The output handler.
  • \Joomla\CMS\Application\CLI\CliInput $cliInput The CLI input handler.
  • \Joomla\Event\DispatcherInterface $dispatcher An optional argument to provide dependency injection for the application's event dispatcher. If the argument is a DispatcherInterface object that object will become the application's event dispatcher, if it is null then the default event dispatcher will be created based on the application's loadDispatcher() method.
  • \Joomla\DI\Container $container Dependency injection container.
Since
  • 1.7.0
Show source code of this method: __construct Source Code

public mixed
(mixed $name)

Magic method to access properties of the application.
Parameters
  • string $name The name of the property.
Returns
  • mixed A value if the property name is valid, null otherwise.
Since
  • 4.0.0
Deprecated
  • 5.0
Show source code of this method: __get Source Code

public \Joomla\Input\Input
()

Method to get the application input object.
Returns
  • \Joomla\Input\Input
Since
  • 4.0.0
Show source code of this method: getInput Source Code

public \Joomla\CMS\Language\Language
()

Method to get the application language object.
Returns
  • \Joomla\CMS\Language\Language The language object
Since
  • 4.0.0
Show source code of this method: getLanguage Source Code

public static \Joomla\CMS\Application\CliApplication
(mixed $name = null)

Returns a reference to the global CliApplication object, only creating it if it doesn't already exist.
Parameters
  • string $name The name (optional) of the Application Cli class to instantiate.
Returns
  • \Joomla\CMS\Application\CliApplication
Since
  • 1.7.0
Deprecated
  • 5.0
-
  • \RuntimeException
Show source code of this method: getInstance Source Code

public void
()

Execute the application.
Returns
  • void
Since
  • 1.7.0
Show source code of this method: execute Source Code

public \Joomla\CMS\Application\CLI\CliOutput
()

Get an output object.
Returns
  • \Joomla\CMS\Application\CLI\CliOutput
Since
  • 4.0.0
Show source code of this method: getOutput Source Code

public \Joomla\CMS\Application\CLI\CliInput
()

Get a CLI input object.
Returns
  • \Joomla\CMS\Application\CLI\CliInput
Since
  • 4.0.0
Show source code of this method: getCliInput Source Code

public $this
(mixed $text = '', mixed $nl = true)

Write a string to standard output.
Parameters
  • string $text The text to display.
  • bool $nl True (default) to append a new line at the end of the output string.
Returns
  • $this
Since
  • 4.0.0
Show source code of this method: out Source Code

public string
()

Get a value from standard input.
Returns
  • string The input string from standard input.
Since
  • 4.0.0
-
Show source code of this method: in Source Code

public $this
(\Joomla\CMS\Application\CLI\CliOutput $output)

Set an output object.
Parameters
  • \Joomla\CMS\Application\CLI\CliOutput $output CliOutput object
Returns
  • $this
Since
  • 3.3
Show source code of this method: setOutput Source Code

public void
(mixed $msg, mixed $type = self::MSG_INFO)

Enqueue a system message.
Parameters
  • string $msg The message to enqueue.
  • string $type The message type.
Returns
  • void
Since
  • 4.0.0
Show source code of this method: enqueueMessage Source Code

public array
()

Get the system message queue.
Returns
  • array The system message queue.
Since
  • 4.0.0
Show source code of this method: getMessageQueue Source Code

public bool
(mixed $identifier)

Check the client interface by name.
Parameters
  • string $identifier String identifier for the application interface
Returns
  • bool True if this application is of the given type client interface.
Since
  • 4.0.0
Show source code of this method: isClient Source Code

public \Joomla\Session\SessionInterface
()

Method to get the application session object.
Returns
  • \Joomla\Session\SessionInterface The session object
Since
  • 4.0.0
Show source code of this method: getSession Source Code

public \Joomla\Registry\Registry
()

Retrieve the application configuration object.
Returns
  • \Joomla\Registry\Registry
Since
  • 4.0.0
Show source code of this method: getConfig Source Code

public bool
()

Flag if the application instance is a CLI or web based application.
Returns
  • bool
Since
  • 4.0.0
Deprecated
  • 5.0
Show source code of this method: isCli Source Code

Properties Summary

protected \Joomla\CMS\Application\CLI\CliOutput
$output
Output object
Since
  • 4.0.0
protected \Joomla\Input\Input
$input
The input.
Since
  • 4.0.0
protected \Joomla\CMS\Application\CLI\CliInput
$cliInput
CLI Input object
Since
  • 4.0.0
protected \Joomla\CMS\Language\Language
$language
The application language object.
Since
  • 4.0.0
protected array
$messages
The application message queue.
Since
  • 4.0.0
protected static \Joomla\CMS\Application\CliApplication
$instance
The application instance.
Since
  • 1.7.0

Tags Summary

Since
2.5.0
Deprecated
5.0
Use the ConsoleApplication instead