[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Application/ -> ConsoleApplication.php (summary)

Joomla! Content Management System

Copyright: (C) 2017 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 579 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ConsoleApplication:: (21 methods):
  __construct()
  __get()
  doExecute()
  execute()
  enqueueMessage()
  getName()
  getDefaultCommands()
  getConfig()
  getInput()
  getLanguage()
  getMessageQueue()
  getSession()
  isClient()
  isCli()
  setSession()
  flushAssets()
  getLongVersion()
  setName()
  getRouter()
  populateHttpHost()
  getDefaultInputDefinition()


Class: ConsoleApplication  - X-Ref

The Joomla! CMS Console Application

__construct(Registry $config,DispatcherInterface $dispatcher,Container $container,Language $language,?InputInterface $input = null,?OutputInterface $output = null)   X-Ref
Class constructor.

param: Registry              $config      An optional argument to provide dependency injection for the application's config object. If the
param: DispatcherInterface   $dispatcher  An optional argument to provide dependency injection for the application's event dispatcher. If the
param: Container             $container   Dependency injection container.
param: Language              $language    The language object provisioned for the application.
param: InputInterface|null   $input       An optional argument to provide dependency injection for the application's input object. If the
param: OutputInterface|null  $output      An optional argument to provide dependency injection for the application's output object. If the

__get($name)   X-Ref
Magic method to access properties of the application.

param: string  $name  The name of the property.
return: mixed   A value if the property name is valid, null otherwise.

doExecute()   X-Ref
Method to run the application routines.

return: integer  The exit code for the application

execute()   X-Ref
Execute the application.

return: void

enqueueMessage($msg, $type = self::MSG_INFO)   X-Ref
Enqueue a system message.

param: string  $msg   The message to enqueue.
param: string  $type  The message type.
return: void

getName()   X-Ref
Gets the name of the current running application.

return: string  The name of the application.

getDefaultCommands()   X-Ref
Get the commands which should be registered by default to the application.

return: \Joomla\Console\Command\AbstractCommand[]

getConfig()   X-Ref
Retrieve the application configuration object.

return: Registry

getInput()   X-Ref
Method to get the application input object.

return: Input

getLanguage()   X-Ref
Method to get the application language object.

return: Language  The language object

getMessageQueue()   X-Ref
Get the system message queue.

return: array  The system message queue.

getSession()   X-Ref
Method to get the application session object.

return: SessionInterface  The session object

isClient($identifier)   X-Ref
Check the client interface by name.

param: string  $identifier  String identifier for the application interface
return: boolean  True if this application is of the given type client interface.

isCli()   X-Ref
Flag if the application instance is a CLI or web based application.

Helper function, you should use the native PHP functions to detect if it is a CLI application.

return: boolean

setSession(SessionInterface $session)   X-Ref
Sets the session for the application to use, if required.

param: SessionInterface  $session  A session object.
return: $this

flushAssets()   X-Ref
Flush the media version to refresh versionable assets

return: void

getLongVersion()   X-Ref
Get the long version string for the application.

Overrides the parent method due to conflicting use of the getName method between the console application and
the CMS application interface.

return: string

setName(string $name)   X-Ref
Set the name of the application.

param: string  $name  The new application name.
return: void

getRouter($name = null, array $options = array()   X-Ref
Returns the application Router object.

param: string  $name     The name of the application.
param: array   $options  An optional associative array of configuration settings.
return: Router

populateHttpHost()   X-Ref
Populates the HTTP_HOST and REQUEST_URI from the URL provided in the --live-site parameter.

If the URL provided is empty or invalid we will use the URL
https://joomla.invalid/set/by/console/application just so that the CLI application doesn't
crash when a WebApplication descendant is instantiated in it.

This is a practical workaround for using any service depending on a WebApplication
descendant under CLI.

Practical example: using a component's MVCFactory which instantiates the SiteRouter
service for that component which in turn relies on an instance of SiteApplication.

return: void

getDefaultInputDefinition()   X-Ref
Builds the default input definition.

return: InputDefinition



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer