[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch




/vendor/symfony/console/Command/ -> Command.php (summary)

(no description)

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

Defines 1 class

Command:: (36 methods):

Class: Command  - X-Ref

Base class for all commands.

__construct($name = null)   X-Ref

param: string|null $name The name of the command; passing null means it must be set in configure()

ignoreValidationErrors()   X-Ref
Ignores validation errors.

This is mainly useful for the help command.

setApplication(Application $application = null)   X-Ref
No description

setHelperSet(HelperSet $helperSet)   X-Ref
No description

getHelperSet()   X-Ref
Gets the helper set.

return: HelperSet A HelperSet instance

getApplication()   X-Ref
Gets the application instance for this command.

return: Application An Application instance

isEnabled()   X-Ref
Checks whether the command is enabled or not in the current environment.

Override this to check for x or y and return false if the command can not
run properly under the current conditions.

return: bool

configure()   X-Ref
Configures the current command.

execute(InputInterface $input, OutputInterface $output)   X-Ref
Executes the current command.

This method is not abstract because you can use this class
as a concrete class. In this case, instead of defining the
execute() method, you set the code to execute by passing
a Closure to the setCode() method.

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

interact(InputInterface $input, OutputInterface $output)   X-Ref
Interacts with the user.

This method is executed before the InputDefinition is validated.
This means that this is the only place where the command can
interactively ask for values of missing required arguments.

initialize(InputInterface $input, OutputInterface $output)   X-Ref
Initializes the command after the input has been bound and before the input
is validated.

This is mainly useful when a lot of commands extends one main command
where some things need to be initialized based on the input arguments and options.

run(InputInterface $input, OutputInterface $output)   X-Ref
Runs the command.

The code to execute is either defined directly with the
setCode() method or by overriding the execute() method
in a sub-class.

return: int The command exit code

setCode($code)   X-Ref
Sets the code to execute when running this command.

If this method is used, it overrides the code defined
in the execute() method.

param: callable $code A callable(InputInterface $input, OutputInterface $output)
return: $this

mergeApplicationDefinition($mergeArgs = true)   X-Ref
Merges the application definition with the command definition.

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

param: bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments

setDefinition($definition)   X-Ref
Sets an array of argument and option instances.

param: array|InputDefinition $definition An array of argument and option instances or a definition instance
return: $this

getDefinition()   X-Ref
Gets the InputDefinition attached to this Command.

return: InputDefinition An InputDefinition instance

getNativeDefinition()   X-Ref
Gets the InputDefinition to be used to create XML and Text representations of this Command.

Can be overridden to provide the original command representation when it would otherwise
be changed by merging with the application InputDefinition.

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

return: InputDefinition An InputDefinition instance

addArgument($name, $mode = null, $description = '', $default = null)   X-Ref
Adds an argument.

param: string               $name        The argument name
param: int|null             $mode        The argument mode: self::REQUIRED or self::OPTIONAL
param: string               $description A description text
param: string|string[]|null $default     The default value (for self::OPTIONAL mode only)
return: $this

addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)   X-Ref
Adds an option.

param: string                        $name        The option name
param: string|array                  $shortcut    The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
param: int|null                      $mode        The option mode: One of the VALUE_* constants
param: string                        $description A description text
param: string|string[]|int|bool|null $default     The default value (must be null for self::VALUE_NONE)
return: $this

setName($name)   X-Ref
Sets the name of the command.

This method can set both the namespace and the name if
you separate them by a colon (:)


param: string $name The command name
return: $this

setProcessTitle($title)   X-Ref
Sets the process title of the command.

This feature should be used only when creating a long process command,
like a daemon.

PHP 5.5+ or the proctitle PECL library is required

param: string $title The process title
return: $this

getName()   X-Ref
Returns the command name.

return: string The command name

setDescription($description)   X-Ref
Sets the description for the command.

param: string $description The description for the command
return: $this

getDescription()   X-Ref
Returns the description for the command.

return: string The description for the command

setHelp($help)   X-Ref
Sets the help for the command.

param: string $help The help for the command
return: $this

getHelp()   X-Ref
Returns the help for the command.

return: string The help for the command

getProcessedHelp()   X-Ref
Returns the processed help for the command replacing the %command.name% and
%command.full_name% patterns with the real values dynamically.

return: string The processed help for the command

setAliases($aliases)   X-Ref
Sets the aliases for the command.

param: string[] $aliases An array of aliases for the command
return: $this

getAliases()   X-Ref
Returns the aliases for the command.

return: array An array of aliases for the command

getSynopsis($short = false)   X-Ref
Returns the synopsis for the command.

param: bool $short Whether to show the short version of the synopsis (with options folded) or not
return: string The synopsis

addUsage($usage)   X-Ref
Add a command usage example.

param: string $usage The usage, it'll be prefixed with the command name
return: $this

getUsages()   X-Ref
Returns alternative usages of the command.

return: array

getHelper($name)   X-Ref
Gets a helper instance by name.

param: string $name The helper name
return: mixed The helper value

asText()   X-Ref
Returns a text representation of the command.

return: string A string representing the command

asXml($asDom = false)   X-Ref
Returns an XML representation of the command.

param: bool $asDom Whether to return a DOM or an XML string
return: string|\DOMDocument An XML string representing the command

validateName($name)   X-Ref
Validates a command name.

It must be non-empty and parts can optionally be separated by ":".

param: string $name

Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1