Back to Joomla project (class list)

Class ConsoleApplication - list of methods

The Joomla! CMS Console Application

Extends

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

Method Summary

public
(\Joomla\Registry\Registry $config, \Joomla\Event\DispatcherInterface $dispatcher, \Joomla\DI\Container $container, \Joomla\CMS\Language\Language $language, ?\Symfony\Component\Console\Input\InputInterface $input = null, ?\Symfony\Component\Console\Output\OutputInterface $output = null)

Class constructor.
Parameters
  • \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\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.
  • \Joomla\CMS\Language\Language $language The language object provisioned for the application.
  • \Symfony\Component\Console\Input\InputInterface|null $input An optional argument to provide dependency injection for the application's input object. If the argument is an InputInterface object that object will become the application's input object, otherwise a default input object is created.
  • \Symfony\Component\Console\Output\OutputInterface|null $output An optional argument to provide dependency injection for the application's output object. If the argument is an OutputInterface object that object will become the application's output object, otherwise a default output object is created.
Since
  • 4.0.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

protected int
()

Method to run the application routines.
Returns
  • int The exit code for the application
Since
  • 4.0.0
-
  • \Throwable
Show source code of this method: doExecute Source Code

public void
()

Execute the application.
Returns
  • void
Since
  • 4.0.0
-
  • \Throwable
Show source code of this method: execute 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 string
()

Gets the name of the current running application.
Returns
  • string The name of the application.
Since
  • 4.0.0
Show source code of this method: getName Source Code

protected \Joomla\Console\Command\AbstractCommand[]
()

Get the commands which should be registered by default to the application.
Returns
  • \Joomla\Console\Command\AbstractCommand[]
Since
  • 4.0.0
Show source code of this method: getDefaultCommands 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 \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 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 \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 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 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

public $this
(\Joomla\Session\SessionInterface $session)

Sets the session for the application to use, if required.
Parameters
  • \Joomla\Session\SessionInterface $session A session object.
Returns
  • $this
Since
  • 4.0.0
Show source code of this method: setSession Source Code

public void
()

Flush the media version to refresh versionable assets
Returns
  • void
Since
  • 4.0.0
Show source code of this method: flushAssets Source Code

public string
()

Get the long version string for the application.
Returns
  • string
Since
  • 4.0.0
Show source code of this method: getLongVersion Source Code

public void
(string $name)

Set the name of the application.
Parameters
  • string $name The new application name.
Returns
  • void
Since
  • 4.0.0
-
  • \RuntimeException because the application name cannot be changed
Show source code of this method: setName Source Code

public static \Joomla\CMS\Router\Router
(mixed $name = null, array $options = array())

Returns the application Router object.
Parameters
  • string $name The name of the application.
  • array $options An optional associative array of configuration settings.
Returns
  • \Joomla\CMS\Router\Router
Since
  • 4.0.6
-
  • \InvalidArgumentException
Show source code of this method: getRouter Source Code

Properties Summary

protected \Joomla\Input\Input
$input
The input.
Since
  • 4.0.0
protected string
$name
The name of the application.
Since
  • 4.0.0
protected \Joomla\CMS\Language\Language
$language
The application language object.
Since
  • 4.0.0
private array
$messages
The application message queue.
Since
  • 4.0.0
private \Joomla\Session\SessionInterface
$session
The application session object.
Since
  • 4.0.0

Tags Summary

Since
4.0.0