TYPO3
7.6
|
Public Member Functions | |
__construct ($name=null) | |
ignoreValidationErrors () | |
setApplication (Application $application=null) | |
setHelperSet (HelperSet $helperSet) | |
getHelperSet () | |
getApplication () | |
isEnabled () | |
run (InputInterface $input, OutputInterface $output) | |
setCode ($code) | |
mergeApplicationDefinition ($mergeArgs=true) | |
setDefinition ($definition) | |
getDefinition () | |
getNativeDefinition () | |
addArgument ($name, $mode=null, $description= '', $default=null) | |
addOption ($name, $shortcut=null, $mode=null, $description= '', $default=null) | |
setName ($name) | |
setProcessTitle ($title) | |
getName () | |
setDescription ($description) | |
getDescription () | |
setHelp ($help) | |
getHelp () | |
getProcessedHelp () | |
setAliases ($aliases) | |
getAliases () | |
getSynopsis ($short=false) | |
addUsage ($usage) | |
getUsages () | |
getHelper ($name) | |
asText () | |
asXml ($asDom=false) | |
Protected Member Functions | |
configure () | |
execute (InputInterface $input, OutputInterface $output) | |
interact (InputInterface $input, OutputInterface $output) | |
initialize (InputInterface $input, OutputInterface $output) | |
Private Member Functions | |
validateName ($name) | |
Private Attributes | |
$application | |
$name | |
$processTitle | |
$aliases = array() | |
$definition | |
$help | |
$description | |
$ignoreValidationErrors = false | |
$applicationDefinitionMerged = false | |
$applicationDefinitionMergedWithArgs = false | |
$code | |
$synopsis = array() | |
$usages = array() | |
$helperSet | |
Base class for all commands.
Definition at line 32 of file vendor/symfony/console/Command/Command.php.
__construct | ( | $name = null | ) |
Constructor.
string | null | $name | The name of the command; passing null means it must be set in configure() |
\LogicException | When the command name is empty |
Definition at line 58 of file vendor/symfony/console/Command/Command.php.
References Command\$name, Command\configure(), and Command\setName().
addArgument | ( | $name, | |
$mode = null , |
|||
$description = '' , |
|||
$default = null |
|||
) |
Adds an argument.
string | $name | The argument name |
int | $mode | The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL |
string | $description | A description text |
mixed | $default | The default value (for InputArgument::OPTIONAL mode only) |
Definition at line 380 of file vendor/symfony/console/Command/Command.php.
References Command\$description, and Command\$name.
addOption | ( | $name, | |
$shortcut = null , |
|||
$mode = null , |
|||
$description = '' , |
|||
$default = null |
|||
) |
Adds an option.
string | $name | The option name |
string | $shortcut | The shortcut (can be null) |
int | $mode | The option mode: One of the InputOption::VALUE_* constants |
string | $description | A description text |
mixed | $default | The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE) |
Definition at line 400 of file vendor/symfony/console/Command/Command.php.
References Command\$description, and Command\$name.
addUsage | ( | $usage | ) |
Add a command usage example.
string | $usage | The usage, it'll be prefixed with the command name |
Definition at line 602 of file vendor/symfony/console/Command/Command.php.
asText | ( | ) |
Returns a text representation of the command.
Definition at line 646 of file vendor/symfony/console/Command/Command.php.
References OutputInterface\VERBOSITY_NORMAL.
asXml | ( | $asDom = false | ) |
Returns an XML representation of the command.
bool | $asDom | Whether to return a DOM or an XML string |
Definition at line 666 of file vendor/symfony/console/Command/Command.php.
|
protected |
Configures the current command.
Definition at line 148 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\__construct().
|
protected |
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.
InputInterface | $input | An InputInterface instance |
OutputInterface | $output | An OutputInterface instance |
\LogicException | When this abstract method is not implemented |
Definition at line 169 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\run().
getAliases | ( | ) |
Returns the aliases for the command.
Definition at line 574 of file vendor/symfony/console/Command/Command.php.
References Command\$aliases.
Referenced by Application\add(), MarkdownDescriptor\describeCommand(), TextDescriptor\describeCommand(), JsonDescriptor\getCommandData(), and XmlDescriptor\getCommandDocument().
getApplication | ( | ) |
Gets the application instance for this command.
Definition at line 127 of file vendor/symfony/console/Command/Command.php.
References Command\$application.
Referenced by HelpCommand\execute().
getDefinition | ( | ) |
Gets the InputDefinition attached to this Command.
Definition at line 348 of file vendor/symfony/console/Command/Command.php.
References Command\$definition.
Referenced by Application\add(), and Command\getNativeDefinition().
getDescription | ( | ) |
Returns the description for the command.
Definition at line 486 of file vendor/symfony/console/Command/Command.php.
References Command\$description.
Referenced by TextDescriptor\describeApplication(), MarkdownDescriptor\describeCommand(), JsonDescriptor\getCommandData(), and XmlDescriptor\getCommandDocument().
getHelp | ( | ) |
Returns the help for the command.
Definition at line 514 of file vendor/symfony/console/Command/Command.php.
References Command\$description.
Referenced by Command\getProcessedHelp().
getHelper | ( | $name | ) |
Gets a helper instance by name.
string | $name | The helper name |
\InvalidArgumentException | if the helper is not defined |
Definition at line 634 of file vendor/symfony/console/Command/Command.php.
References Command\$name.
getHelperSet | ( | ) |
Gets the helper set.
Definition at line 115 of file vendor/symfony/console/Command/Command.php.
References Command\$helperSet.
Referenced by Application\doRunCommand().
getName | ( | ) |
Returns the command name.
Definition at line 458 of file vendor/symfony/console/Command/Command.php.
References Command\$name.
Referenced by Application\add(), TextDescriptor\describeApplication(), MarkdownDescriptor\describeCommand(), JsonDescriptor\getCommandData(), and XmlDescriptor\getCommandDocument().
getNativeDefinition | ( | ) |
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.
Definition at line 363 of file vendor/symfony/console/Command/Command.php.
References Command\getDefinition().
Referenced by MarkdownDescriptor\describeCommand(), TextDescriptor\describeCommand(), JsonDescriptor\getCommandData(), and XmlDescriptor\getCommandDocument().
getProcessedHelp | ( | ) |
Returns the processed help for the command replacing the command.name% and command.full_name% patterns with the real values dynamically.
Definition at line 525 of file vendor/symfony/console/Command/Command.php.
References Command\$name, and Command\getHelp().
Referenced by MarkdownDescriptor\describeCommand(), TextDescriptor\describeCommand(), JsonDescriptor\getCommandData(), and XmlDescriptor\getCommandDocument().
getSynopsis | ( | $short = false | ) |
Returns the synopsis for the command.
bool | $short | Whether to show the short version of the synopsis (with options folded) or not |
Definition at line 586 of file vendor/symfony/console/Command/Command.php.
Referenced by MarkdownDescriptor\describeCommand(), TextDescriptor\describeCommand(), JsonDescriptor\getCommandData(), XmlDescriptor\getCommandDocument(), and Command\run().
getUsages | ( | ) |
Returns alternative usages of the command.
Definition at line 618 of file vendor/symfony/console/Command/Command.php.
References Command\$usages.
Referenced by MarkdownDescriptor\describeCommand(), TextDescriptor\describeCommand(), JsonDescriptor\getCommandData(), and XmlDescriptor\getCommandDocument().
ignoreValidationErrors | ( | ) |
Ignores validation errors.
This is mainly useful for the help command.
Definition at line 78 of file vendor/symfony/console/Command/Command.php.
Referenced by HelpCommand\configure(), and Command\run().
|
protected |
Initializes the command just after the input has been 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.
InputInterface | $input | An InputInterface instance |
OutputInterface | $output | An OutputInterface instance |
Definition at line 197 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\run().
|
protected |
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.
InputInterface | $input | An InputInterface instance |
OutputInterface | $output | An OutputInterface instance |
Definition at line 184 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\run().
isEnabled | ( | ) |
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.
Definition at line 140 of file vendor/symfony/console/Command/Command.php.
Referenced by Application\add().
mergeApplicationDefinition | ( | $mergeArgs = true | ) |
Merges the application definition with the command definition.
This method is not part of public API and should not be used directly.
bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments |
Definition at line 299 of file vendor/symfony/console/Command/Command.php.
Referenced by MarkdownDescriptor\describeCommand(), TextDescriptor\describeCommand(), JsonDescriptor\getCommandData(), XmlDescriptor\getCommandDocument(), and Command\run().
run | ( | InputInterface | $input, |
OutputInterface | $output | ||
) |
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.
InputInterface | $input | An InputInterface instance |
OutputInterface | $output | An OutputInterface instance |
\Exception |
Definition at line 220 of file vendor/symfony/console/Command/Command.php.
References InputInterface\bind(), elseif, Command\execute(), Command\getSynopsis(), OutputInterface\getVerbosity(), Command\ignoreValidationErrors(), Command\initialize(), Command\interact(), InputInterface\isInteractive(), Command\mergeApplicationDefinition(), InputInterface\validate(), OutputInterface\VERBOSITY_VERY_VERBOSE, and OutputInterface\writeln().
Referenced by Application\doRunCommand().
setAliases | ( | $aliases | ) |
Sets the aliases for the command.
string[] | $aliases An array of aliases for the command |
\InvalidArgumentException | When an alias is invalid |
Definition at line 552 of file vendor/symfony/console/Command/Command.php.
References Command\$aliases, and Command\validateName().
setApplication | ( | Application | $application = null | ) |
Sets the application instance for this command.
Application | $application | An Application instance |
Definition at line 90 of file vendor/symfony/console/Command/Command.php.
References Command\$application, and Command\setHelperSet().
Referenced by Application\add().
setCode | ( | $code | ) |
Sets the code to execute when running this command.
If this method is used, it overrides the code defined in the execute() method.
callable | $code | A callable(InputInterface $input, OutputInterface $output) |
\InvalidArgumentException |
Definition at line 281 of file vendor/symfony/console/Command/Command.php.
References Command\$code.
setDefinition | ( | $definition | ) |
Sets an array of argument and option instances.
array | InputDefinition | $definition | An array of argument and option instances or a definition instance |
Definition at line 328 of file vendor/symfony/console/Command/Command.php.
References Command\$definition.
setDescription | ( | $description | ) |
Sets the description for the command.
string | $description | The description for the command |
Definition at line 472 of file vendor/symfony/console/Command/Command.php.
References Command\$description.
setHelp | ( | $help | ) |
Sets the help for the command.
string | $help | The help for the command |
Definition at line 500 of file vendor/symfony/console/Command/Command.php.
References Command\$help.
setHelperSet | ( | HelperSet | $helperSet | ) |
Sets the helper set.
HelperSet | $helperSet | A HelperSet instance |
Definition at line 105 of file vendor/symfony/console/Command/Command.php.
References Command\$helperSet.
Referenced by Command\setApplication().
setName | ( | $name | ) |
Sets the name of the command.
This method can set both the namespace and the name if you separate them by a colon (:)
$command->setName('foo:bar');
string | $name | The command name |
\InvalidArgumentException | When the name is invalid |
Definition at line 423 of file vendor/symfony/console/Command/Command.php.
References Command\$name, and Command\validateName().
Referenced by Command\__construct(), Foo4Command\configure(), and BarBucCommand\configure().
setProcessTitle | ( | $title | ) |
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
string | $title | The process title |
Definition at line 444 of file vendor/symfony/console/Command/Command.php.
|
private |
Validates a command name.
It must be non-empty and parts can optionally be separated by ":".
string | $name |
\InvalidArgumentException | When the name is invalid |
Definition at line 691 of file vendor/symfony/console/Command/Command.php.
References Command\$name.
Referenced by Command\setAliases(), and Command\setName().
|
private |
Definition at line 37 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\getAliases(), and Command\setAliases().
|
private |
Definition at line 34 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\getApplication(), and Command\setApplication().
|
private |
Definition at line 42 of file vendor/symfony/console/Command/Command.php.
|
private |
Definition at line 43 of file vendor/symfony/console/Command/Command.php.
|
private |
Definition at line 44 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\setCode().
|
private |
Definition at line 38 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\getDefinition(), and Command\setDefinition().
|
private |
Definition at line 40 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\addArgument(), Command\addOption(), Command\getDescription(), Command\getHelp(), and Command\setDescription().
|
private |
Definition at line 39 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\setHelp().
|
private |
Definition at line 47 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\getHelperSet(), and Command\setHelperSet().
|
private |
Definition at line 41 of file vendor/symfony/console/Command/Command.php.
|
private |
Definition at line 35 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\__construct(), Command\addArgument(), Command\addOption(), Command\getHelper(), Command\getName(), Command\getProcessedHelp(), Command\setName(), and Command\validateName().
|
private |
Definition at line 36 of file vendor/symfony/console/Command/Command.php.
|
private |
Definition at line 45 of file vendor/symfony/console/Command/Command.php.
|
private |
Definition at line 46 of file vendor/symfony/console/Command/Command.php.
Referenced by Command\getUsages().