[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/console/src/ -> Application.php (summary)

Part of the Joomla Framework Console Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 1392 lines (33 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Application:: (38 methods):
  __construct()
  addCommand()
  configureIO()
  doExecute()
  execute()
  findNamespace()
  getAllCommands()
  getCommand()
  getCommandName()
  getCommands()
  getConsoleInput()
  getConsoleOutput()
  getDefaultCommands()
  getDefaultInputDefinition()
  getDefaultHelperSet()
  getDefinition()
  getHelperSet()
  getLongVersion()
  getName()
  getNamespaces()
  getVersion()
  hasCommand()
  initialise()
  renderThrowable()
  doRenderThrowable()
  splitStringByWidth()
  runCommand()
  setAutoExit()
  setCatchThrowables()
  setCommandLoader()
  setHelperSet()
  setName()
  setVersion()
  shouldAutoExit()
  shouldCatchThrowables()
  extractAllNamespaces()
  extractNamespace()
  initCommands()


Class: Application  - X-Ref

Base application class for a Joomla! command line application.

__construct(?InputInterface $input = null, ?OutputInterface $output = null, ?Registry $config = null)   X-Ref
Class constructor.

param: InputInterface   $input   An optional argument to provide dependency injection for the application's input object.  If the argument is
param: OutputInterface  $output  An optional argument to provide dependency injection for the application's output object.  If the argument
param: Registry         $config  An optional argument to provide dependency injection for the application's config object.  If the argument

addCommand(AbstractCommand $command)   X-Ref
Adds a command object.

If a command with the same name already exists, it will be overridden. If the command is not enabled it will not be added.

param: AbstractCommand  $command  The command to add to the application.
return: AbstractCommand

configureIO()   X-Ref
Configures the console input and output instances for the process.

return: void

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

findNamespace(string $namespace)   X-Ref
Finds a registered namespace by a name.

param: string  $namespace  A namespace to search for
return: string

getAllCommands(string $namespace = '')   X-Ref
No description

getCommand(string $name)   X-Ref
Returns a registered command by name or alias.

param: string  $name  The command name or alias
return: AbstractCommand

getCommandName(InputInterface $input)   X-Ref
Get the name of the command to run.

param: InputInterface  $input  The input to read the argument from
return: string|null

getCommands()   X-Ref
Get the registered commands.

This method only retrieves commands which have been explicitly registered.  To get all commands including those from a
command loader, use the `getAllCommands()` method.

return: AbstractCommand[]

getConsoleInput()   X-Ref
Get the console input handler.

return: InputInterface

getConsoleOutput()   X-Ref
Get the console output handler.

return: OutputInterface

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

return: AbstractCommand[]

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

return: InputDefinition

getDefaultHelperSet()   X-Ref
Builds the default helper set.

return: HelperSet

getDefinition()   X-Ref
Gets the InputDefinition related to this Application.

return: InputDefinition

getHelperSet()   X-Ref
Get the helper set associated with the application.

return: HelperSet

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

Typically, this is the application name and version and is used in the application help output.

return: string

getName()   X-Ref
Get the name of the application.

return: string

getNamespaces()   X-Ref
Returns an array of all unique namespaces used by currently registered commands.

Note that this does not include the global namespace which always exists.

return: string[]

getVersion()   X-Ref
Get the version of the application.

return: string

hasCommand(string $name)   X-Ref
Check if the application has a command with the given name.

param: string  $name  The name of the command to check for existence.
return: boolean

initialise()   X-Ref
Custom initialisation method.

return: void

renderThrowable(\Throwable $throwable)   X-Ref
Renders an error message for a Throwable object

param: \Throwable  $throwable  The Throwable object to render the message for.
return: void

doRenderThrowable(\Throwable $throwable, OutputInterface $output)   X-Ref
Handles recursively rendering error messages for a Throwable and all previous Throwables contained within.

param: \Throwable       $throwable  The Throwable object to render the message for.
param: OutputInterface  $output     The output object to send the message to.
return: void

splitStringByWidth(string $string, int $width)   X-Ref
No description

runCommand(AbstractCommand $command, InputInterface $input, OutputInterface $output)   X-Ref
Run the given command.

param: AbstractCommand  $command  The command to run.
param: InputInterface   $input    The input to inject into the command.
param: OutputInterface  $output   The output to inject into the command.
return: integer

setAutoExit(bool $autoExit)   X-Ref
Set whether the application should auto exit.

param: boolean  $autoExit  The auto exit state.
return: void

setCatchThrowables(bool $catchThrowables)   X-Ref
Set whether the application should catch Throwables.

param: boolean  $catchThrowables  The catch Throwables state.
return: void

setCommandLoader(Loader\LoaderInterface $loader)   X-Ref
Set the command loader.

param: Loader\LoaderInterface  $loader  The new command loader.
return: void

setHelperSet(HelperSet $helperSet)   X-Ref
Set the application's helper set.

param: HelperSet  $helperSet  The new HelperSet.
return: void

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

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

setVersion(string $version)   X-Ref
Set the version of the application.

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

shouldAutoExit()   X-Ref
Get the application's auto exit state.

return: boolean

shouldCatchThrowables()   X-Ref
Get the application's catch Throwables state.

return: boolean

extractAllNamespaces(string $name)   X-Ref
Returns all namespaces of the command name.

param: string  $name  The full name of the command
return: string[]

extractNamespace(string $name, ?int $limit = null)   X-Ref
Returns the namespace part of the command name.

param: string   $name   The command name to process
param: integer  $limit  The maximum number of parts of the namespace
return: string

initCommands()   X-Ref
Internal function to initialise the command store, this allows the store to be lazy loaded only when needed.

return: void



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