[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

(no description)

File Size: 1276 lines (44 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Application:: (49 methods):
  __construct()
  setDispatcher()
  setCommandLoader()
  getSignalRegistry()
  setSignalsToDispatchEvent()
  run()
  doRun()
  reset()
  setHelperSet()
  getHelperSet()
  setDefinition()
  getDefinition()
  complete()
  getHelp()
  areExceptionsCaught()
  setCatchExceptions()
  isAutoExitEnabled()
  setAutoExit()
  getName()
  setName()
  getVersion()
  setVersion()
  getLongVersion()
  register()
  addCommands()
  add()
  get()
  has()
  getNamespaces()
  findNamespace()
  find()
  all()
  getAbbreviations()
  renderThrowable()
  doRenderThrowable()
  configureIO()
  doRunCommand()
  getCommandName()
  getDefaultInputDefinition()
  getDefaultCommands()
  getDefaultHelperSet()
  getAbbreviationSuggestions()
  extractNamespace()
  findAlternatives()
  setDefaultCommand()
  isSingleCommand()
  splitStringByWidth()
  extractAllNamespaces()
  init()


Class: Application  - X-Ref

An Application is the container for a collection of commands.

It is the main entry point of a Console application.

This class is optimized for a standard CLI environment.

Usage:

$app = new Application('myapp', '1.0 (stable)');
$app->add(new SimpleCommand());
$app->run();

__construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')   X-Ref
No description

setDispatcher(EventDispatcherInterface $dispatcher)   X-Ref


setCommandLoader(CommandLoaderInterface $commandLoader)   X-Ref
No description

getSignalRegistry()   X-Ref
No description

setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)   X-Ref
No description

run(InputInterface $input = null, OutputInterface $output = null)   X-Ref
Runs the current application.

return: int 0 if everything went fine, or an error code

doRun(InputInterface $input, OutputInterface $output)   X-Ref
Runs the current application.

return: int 0 if everything went fine, or an error code

reset()   X-Ref
{@inheritdoc}


setHelperSet(HelperSet $helperSet)   X-Ref
No description

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

return: HelperSet

setDefinition(InputDefinition $definition)   X-Ref
No description

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

return: InputDefinition

complete(CompletionInput $input, CompletionSuggestions $suggestions)   X-Ref
Adds suggestions to $suggestions for the current completion input (e.g. option or argument).


getHelp()   X-Ref
Gets the help message.

return: string

areExceptionsCaught()   X-Ref
Gets whether to catch exceptions or not during commands execution.

return: bool

setCatchExceptions(bool $boolean)   X-Ref
Sets whether to catch exceptions or not during commands execution.


isAutoExitEnabled()   X-Ref
Gets whether to automatically exit after a command execution or not.

return: bool

setAutoExit(bool $boolean)   X-Ref
Sets whether to automatically exit after a command execution or not.


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

return: string

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


getVersion()   X-Ref
Gets the application version.

return: string

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


getLongVersion()   X-Ref
Returns the long version of the application.

return: string

register(string $name)   X-Ref
Registers a new command.

return: Command

addCommands(array $commands)   X-Ref
Adds an array of command objects.

If a Command is not enabled it will not be added.

param: Command[] $commands An array of commands

add(Command $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.

return: Command|null

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

return: Command

has(string $name)   X-Ref
Returns true if the command exists, false otherwise.

return: bool

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

It does not return the global namespace which always exists.

return: string[]

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

return: string

find(string $name)   X-Ref
Finds a command by name or alias.

Contrary to get, this command tries to find the best
match if you give it an abbreviation of a name or alias.

return: Command

all(string $namespace = null)   X-Ref
Gets the commands (registered in the given namespace if provided).

The array keys are the full names and the values the command instances.

return: Command[]

getAbbreviations(array $names)   X-Ref
Returns an array of possible abbreviations given a set of names.

return: string[][]

renderThrowable(\Throwable $e, OutputInterface $output)   X-Ref
No description

doRenderThrowable(\Throwable $e, OutputInterface $output)   X-Ref
No description

configureIO(InputInterface $input, OutputInterface $output)   X-Ref
Configures the input and output instances based on the user arguments and options.


doRunCommand(Command $command, InputInterface $input, OutputInterface $output)   X-Ref
Runs the current command.

If an event dispatcher has been attached to the application,
events are also dispatched during the life-cycle of the command.

return: int 0 if everything went fine, or an error code

getCommandName(InputInterface $input)   X-Ref
Gets the name of the command based on input.

return: string|null

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

return: InputDefinition

getDefaultCommands()   X-Ref
Gets the default commands that should always be available.

return: Command[]

getDefaultHelperSet()   X-Ref
Gets the default helper set with the helpers that should always be available.

return: HelperSet

getAbbreviationSuggestions(array $abbrevs)   X-Ref
Returns abbreviated suggestions in string format.


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

This method is not part of public API and should not be used directly.

return: string

findAlternatives(string $name, iterable $collection)   X-Ref
Finds alternative of $name among $collection,
if nothing is found in $collection, try in $abbrevs.

return: string[]

setDefaultCommand(string $commandName, bool $isSingleCommand = false)   X-Ref
Sets the default Command name.

return: $this

isSingleCommand()   X-Ref


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

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

return: string[]

init()   X-Ref
No description



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