MIOLO20
|
Membros públicos | |
__construct ($name='UNKNOWN', $version='UNKNOWN') | |
run (InputInterface $input=null, OutputInterface $output=null) | |
doRun (InputInterface $input, OutputInterface $output) | |
setHelperSet (HelperSet $helperSet) | |
getHelperSet () | |
getDefinition () | |
getHelp () | |
setCatchExceptions ($boolean) | |
setAutoExit ($boolean) | |
getName () | |
setName ($name) | |
getVersion () | |
setVersion ($version) | |
getLongVersion () | |
register ($name) | |
addCommands (array $commands) | |
add (Command $command) | |
get ($name) | |
has ($name) | |
getNamespaces () | |
findNamespace ($namespace) | |
find ($name) | |
all ($namespace=null) | |
asText ($namespace=null) | |
asXml ($namespace=null, $asDom=false) | |
renderException ($e, $output) | |
Membros públicos estáticos | |
static | getAbbreviations ($names) |
Membros protegidos | |
getCommandName (InputInterface $input) | |
sortCommands ($commands) | |
getAbbreviationSuggestions ($abbrevs) | |
Atributos Protegidos | |
$commands | |
$aliases | |
$wantHelps = false | |
$runningCommand | |
$name | |
$version | |
$catchExceptions | |
$autoExit | |
$definition | |
$helperSet | |
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();
Definido na linha 45 do ficheiro Application.php.
__construct | ( | $name = 'UNKNOWN', | |
$version = 'UNKNOWN' ) |
Constructor.
string | $name | The name of the application |
string | $version | The version of the application |
Definido na linha 64 do ficheiro Application.php.
add | ( | Command | $command | ) |
Adds a command object.
If a command with the same name already exists, it will be overridden.
Command | $command | A Command object |
Definido na linha 356 do ficheiro Application.php.
addCommands | ( | array | $commands | ) |
Adds an array of command objects.
Command[] | $commands | An array of commands |
Definido na linha 340 do ficheiro Application.php.
all | ( | $namespace = null | ) |
Gets the commands (registered in the given namespace if provided).
The array keys are the full names and the values the command instances.
string | $namespace | A namespace name |
Definido na linha 515 do ficheiro Application.php.
asText | ( | $namespace = null | ) |
Returns a text representation of the Application.
string | $namespace | An optional namespace name |
Definido na linha 567 do ficheiro Application.php.
asXml | ( | $namespace = null, | |
$asDom = false ) |
Returns an XML representation of the Application.
string | $namespace | An optional namespace name |
Boolean | $asDom | Whether to return a DOM or an XML string |
Definido na linha 608 do ficheiro Application.php.
doRun | ( | InputInterface | $input, |
OutputInterface | $output ) |
Runs the current application.
InputInterface | $input | An Input instance |
OutputInterface | $output | An Output instance |
Definido na linha 145 do ficheiro Application.php.
find | ( | $name | ) |
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.
string | $name | A command name or a command alias |
InvalidArgumentException When command name is incorrect or ambiguous
Definido na linha 463 do ficheiro Application.php.
findNamespace | ( | $namespace | ) |
Finds a registered namespace by a name or an abbreviation.
InvalidArgumentException When namespace is incorrect or ambiguous
Definido na linha 436 do ficheiro Application.php.
get | ( | $name | ) |
Returns a registered command by name or alias.
string | $name | The command name or alias |
InvalidArgumentException When command name given does not exist
Definido na linha 378 do ficheiro Application.php.
|
static |
Returns an array of possible abbreviations given a set of names.
array | $names | An array of names |
Definido na linha 538 do ficheiro Application.php.
|
protected |
Definido na linha 739 do ficheiro Application.php.
|
protected |
Definido na linha 713 do ficheiro Application.php.
getDefinition | ( | ) |
Gets the InputDefinition related to this Application.
Definido na linha 218 do ficheiro Application.php.
getHelp | ( | ) |
Gets the help message.
Definido na linha 228 do ficheiro Application.php.
getHelperSet | ( | ) |
Get the helper set associated with the command
Definido na linha 208 do ficheiro Application.php.
getLongVersion | ( | ) |
Returns the long version of the application.
Definido na linha 314 do ficheiro Application.php.
getName | ( | ) |
Gets the name of the application.
Definido na linha 274 do ficheiro Application.php.
getNamespaces | ( | ) |
Returns an array of all unique namespaces used by currently registered commands.
It does not returns the global namespace which always exists.
Definido na linha 417 do ficheiro Application.php.
getVersion | ( | ) |
Gets the application version.
Definido na linha 294 do ficheiro Application.php.
has | ( | $name | ) |
Returns true if the command exists, false otherwise
string | $name | The command name or alias |
Definido na linha 405 do ficheiro Application.php.
register | ( | $name | ) |
Registers a new command.
string | $name | The command name |
Definido na linha 330 do ficheiro Application.php.
renderException | ( | $e, | |
$output ) |
Renders a catched exception.
Exception | $e | An exception instance |
OutputInterface | $output | An OutputInterface instance |
Definido na linha 653 do ficheiro Application.php.
run | ( | InputInterface | $input = null, |
OutputInterface | $output = null ) |
Runs the current application.
InputInterface | $input | An Input instance |
OutputInterface | $output | An Output instance |
Exception When doRun returns Exception
Definido na linha 102 do ficheiro Application.php.
setAutoExit | ( | $boolean | ) |
Sets whether to automatically exit after a command execution or not.
Boolean | $boolean | Whether to automatically exit after a command execution or not |
Definido na linha 264 do ficheiro Application.php.
setCatchExceptions | ( | $boolean | ) |
Sets whether to catch exceptions or not during commands execution.
Boolean | $boolean | Whether to catch exceptions or not during commands execution |
Definido na linha 254 do ficheiro Application.php.
setHelperSet | ( | HelperSet | $helperSet | ) |
Set a helper set to be used with the command.
HelperSet | $helperSet | The helper set |
Definido na linha 198 do ficheiro Application.php.
setName | ( | $name | ) |
Sets the application name.
string | $name | The application name |
Definido na linha 284 do ficheiro Application.php.
setVersion | ( | $version | ) |
Sets the application version.
string | $version | The application version |
Definido na linha 304 do ficheiro Application.php.
|
protected |
Definido na linha 718 do ficheiro Application.php.
|
protected |
Definido na linha 48 do ficheiro Application.php.
|
protected |
Definido na linha 54 do ficheiro Application.php.
|
protected |
Definido na linha 53 do ficheiro Application.php.
|
protected |
Definido na linha 47 do ficheiro Application.php.
|
protected |
Definido na linha 55 do ficheiro Application.php.
|
protected |
Definido na linha 56 do ficheiro Application.php.
|
protected |
Definido na linha 51 do ficheiro Application.php.
|
protected |
Definido na linha 50 do ficheiro Application.php.
|
protected |
Definido na linha 52 do ficheiro Application.php.
|
protected |
Definido na linha 49 do ficheiro Application.php.