TYPO3
7.6
|
Public Member Functions | |
__construct ($name= 'UNKNOWN', $version= 'UNKNOWN') | |
setDispatcher (EventDispatcherInterface $dispatcher) | |
run (InputInterface $input=null, OutputInterface $output=null) | |
doRun (InputInterface $input, OutputInterface $output) | |
setHelperSet (HelperSet $helperSet) | |
getHelperSet () | |
setDefinition (InputDefinition $definition) | |
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, $raw=false) | |
asXml ($namespace=null, $asDom=false) | |
renderException ($e, $output) | |
getTerminalDimensions () | |
setTerminalDimensions ($width, $height) | |
extractNamespace ($name, $limit=null) | |
setDefaultCommand ($commandName) | |
Static Public Member Functions | |
static | getAbbreviations ($names) |
Protected Member Functions | |
getTerminalWidth () | |
getTerminalHeight () | |
configureIO (InputInterface $input, OutputInterface $output) | |
doRunCommand (Command $command, InputInterface $input, OutputInterface $output) | |
getCommandName (InputInterface $input) | |
getDefaultInputDefinition () | |
getDefaultCommands () | |
getDefaultHelperSet () | |
Private Member Functions | |
getSttyColumns () | |
getConsoleMode () | |
getAbbreviationSuggestions ($abbrevs) | |
findAlternatives ($name, $collection) | |
stringWidth ($string) | |
splitStringByWidth ($string, $width) | |
extractAllNamespaces ($name) | |
Private Attributes | |
$commands = array() | |
$wantHelps = false | |
$runningCommand | |
$name | |
$version | |
$catchExceptions = true | |
$autoExit = true | |
$definition | |
$helperSet | |
$dispatcher | |
$terminalDimensions | |
$defaultCommand | |
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();
Definition at line 60 of file vendor/symfony/console/Application.php.
__construct | ( | $name = 'UNKNOWN' , |
|
$version = 'UNKNOWN' |
|||
) |
Constructor.
string | $name | The name of the application |
string | $version | The version of the application |
Definition at line 83 of file vendor/symfony/console/Application.php.
References Application\$name, Application\$version, Application\add(), Application\getDefaultCommands(), Application\getDefaultHelperSet(), and Application\getDefaultInputDefinition().
add | ( | Command | $command | ) |
Adds a command object.
If a command with the same name already exists, it will be overridden.
Definition at line 384 of file vendor/symfony/console/Application.php.
References Command\getAliases(), Command\getDefinition(), Command\getName(), Command\isEnabled(), and Command\setApplication().
Referenced by DescriptorApplication2\__construct(), Application\__construct(), CustomDefaultCommandApplication\__construct(), Application\addCommands(), and Application\register().
addCommands | ( | array | $commands | ) |
Adds an array of command objects.
Command[] | $commands An array of commands |
Definition at line 366 of file vendor/symfony/console/Application.php.
References Application\add().
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 |
Definition at line 583 of file vendor/symfony/console/Application.php.
References Application\$commands, Application\$name, and Application\extractNamespace().
Referenced by ApplicationTest\ensureStaticCommandHelp(), and AbstractDescriptorTest\testDescribeApplication().
asText | ( | $namespace = null , |
|
$raw = false |
|||
) |
Returns a text representation of the Application.
string | $namespace | An optional namespace name |
bool | $raw | Whether to return raw command list |
Definition at line 629 of file vendor/symfony/console/Application.php.
References OutputInterface\VERBOSITY_NORMAL.
asXml | ( | $namespace = null , |
|
$asDom = false |
|||
) |
Returns an XML representation of the Application.
string | $namespace | An optional namespace name |
bool | $asDom | Whether to return a DOM or an XML string |
Definition at line 650 of file vendor/symfony/console/Application.php.
|
protected |
Configures the input and output instances based on the user arguments and options.
InputInterface | $input | An InputInterface instance |
OutputInterface | $output | An OutputInterface instance |
Definition at line 825 of file vendor/symfony/console/Application.php.
References elseif, Application\getHelperSet(), InputInterface\getParameterOption(), Application\has(), InputInterface\hasParameterOption(), OutputInterface\setDecorated(), InputInterface\setInteractive(), OutputInterface\setVerbosity(), OutputInterface\VERBOSITY_DEBUG, OutputInterface\VERBOSITY_QUIET, OutputInterface\VERBOSITY_VERBOSE, and OutputInterface\VERBOSITY_VERY_VERBOSE.
Referenced by Application\run().
doRun | ( | InputInterface | $input, |
OutputInterface | $output | ||
) |
Runs the current application.
Definition at line 168 of file vendor/symfony/console/Application.php.
References Application\$defaultCommand, Application\$name, Application\doRunCommand(), Application\find(), Application\getCommandName(), Application\getLongVersion(), InputInterface\hasParameterOption(), and OutputInterface\writeln().
Referenced by Application\run().
|
protected |
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.
Command | $command | A Command instance |
InputInterface | $input | An Input instance |
OutputInterface | $output | An Output instance |
\Exception | when the command being run threw an exception |
Definition at line 869 of file vendor/symfony/console/Application.php.
References ConsoleEvents\COMMAND, ConsoleEvents\EXCEPTION, ConsoleExceptionEvent\getException(), Command\getHelperSet(), ConsoleCommandEvent\RETURN_CODE_DISABLED, Command\run(), and ConsoleEvents\TERMINATE.
Referenced by Application\doRun().
|
private |
Returns all namespaces of the command name.
string | $name | The full name of the command |
Definition at line 1161 of file vendor/symfony/console/Application.php.
References Application\$name.
Referenced by Application\getNamespaces().
extractNamespace | ( | $name, | |
$limit = null |
|||
) |
Returns the namespace part of the command name.
This method is not part of public API and should not be used directly.
string | $name | The full name of the command |
string | $limit | The maximum number of parts of the namespace |
Definition at line 1036 of file vendor/symfony/console/Application.php.
References Application\$name.
Referenced by Application\all().
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 |
Definition at line 526 of file vendor/symfony/console/Application.php.
References Application\$commands, Application\$name, Application\findAlternatives(), Application\findNamespace(), and Application\getAbbreviationSuggestions().
Referenced by Application\doRun().
|
private |
Finds alternative of $name among $collection, if nothing is found in $collection, try in $abbrevs.
string | $name | The string |
array | \Traversable | $collection | The collection |
Definition at line 1053 of file vendor/symfony/console/Application.php.
References Application\$name, and elseif.
Referenced by Application\find(), and Application\findNamespace().
findNamespace | ( | $namespace | ) |
Finds a registered namespace by a name or an abbreviation.
string | $namespace | A namespace or abbreviation to search for |
\InvalidArgumentException | When namespace is incorrect or ambiguous |
Definition at line 482 of file vendor/symfony/console/Application.php.
References Application\findAlternatives(), Application\getAbbreviationSuggestions(), and Application\getNamespaces().
Referenced by Application\find().
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 |
Definition at line 418 of file vendor/symfony/console/Application.php.
References Application\$name.
|
static |
Returns an array of possible abbreviations given a set of names.
array | $names | An array of names |
Definition at line 606 of file vendor/symfony/console/Application.php.
References Application\$name.
|
private |
Returns abbreviated suggestions in string format.
array | $abbrevs | Abbreviated suggestions to convert |
Definition at line 1021 of file vendor/symfony/console/Application.php.
Referenced by Application\find(), and Application\findNamespace().
|
protected |
Gets the name of the command based on input.
InputInterface | $input | The input interface |
Definition at line 913 of file vendor/symfony/console/Application.php.
References InputInterface\getFirstArgument().
Referenced by Application\doRun().
|
private |
Runs and parses mode CON if it's available, suppressing any error output.
Definition at line 994 of file vendor/symfony/console/Application.php.
Referenced by Application\getTerminalDimensions().
|
protected |
Gets the default commands that should always be available.
Definition at line 943 of file vendor/symfony/console/Application.php.
Referenced by Application\__construct().
|
protected |
Gets the default helper set with the helpers that should always be available.
Definition at line 953 of file vendor/symfony/console/Application.php.
Referenced by Application\__construct().
|
protected |
Gets the default input definition.
Definition at line 923 of file vendor/symfony/console/Application.php.
References InputArgument\REQUIRED, and InputOption\VALUE_NONE.
Referenced by Application\__construct().
getDefinition | ( | ) |
Gets the InputDefinition related to this Application.
Definition at line 242 of file vendor/symfony/console/Application.php.
References Application\$definition.
Referenced by TextDescriptor\describeApplication().
getHelp | ( | ) |
Gets the help message.
Definition at line 252 of file vendor/symfony/console/Application.php.
References Application\getLongVersion().
Referenced by TextDescriptor\describeApplication().
getHelperSet | ( | ) |
Get the helper set associated with the command.
Definition at line 220 of file vendor/symfony/console/Application.php.
References Application\$helperSet.
Referenced by Application\configureIO().
getLongVersion | ( | ) |
Returns the long version of the application.
Definition at line 336 of file vendor/symfony/console/Application.php.
References Application\getName(), and Application\getVersion().
Referenced by Application\doRun(), and Application\getHelp().
getName | ( | ) |
Gets the name of the application.
Definition at line 288 of file vendor/symfony/console/Application.php.
References Application\$name.
Referenced by Shell\__construct(), MarkdownDescriptor\describeApplication(), XmlDescriptor\getApplicationDocument(), Application\getLongVersion(), and Application\renderException().
getNamespaces | ( | ) |
Returns an array of all unique namespaces used by currently registered commands.
It does not returns the global namespace which always exists.
Definition at line 459 of file vendor/symfony/console/Application.php.
References Application\extractAllNamespaces().
Referenced by Application\findNamespace().
|
private |
Runs and parses stty -a if it's available, suppressing any error output.
Definition at line 971 of file vendor/symfony/console/Application.php.
Referenced by Application\getTerminalDimensions().
getTerminalDimensions | ( | ) |
Tries to figure out the terminal dimensions based on the current environment.
Definition at line 771 of file vendor/symfony/console/Application.php.
References Application\$terminalDimensions, Application\getConsoleMode(), and Application\getSttyColumns().
Referenced by Application\getTerminalHeight(), and Application\getTerminalWidth().
|
protected |
Tries to figure out the terminal height in which this application runs.
Definition at line 759 of file vendor/symfony/console/Application.php.
References Application\getTerminalDimensions().
|
protected |
Tries to figure out the terminal width in which this application runs.
Definition at line 747 of file vendor/symfony/console/Application.php.
References Application\getTerminalDimensions().
Referenced by Application\renderException().
getVersion | ( | ) |
Gets the application version.
Definition at line 312 of file vendor/symfony/console/Application.php.
References Application\$version.
Referenced by XmlDescriptor\getApplicationDocument(), and Application\getLongVersion().
has | ( | $name | ) |
Returns true if the command exists, false otherwise.
string | $name | The command name or alias |
Definition at line 447 of file vendor/symfony/console/Application.php.
References Application\$name.
Referenced by Application\configureIO().
register | ( | $name | ) |
Registers a new command.
string | $name | The command name |
Definition at line 354 of file vendor/symfony/console/Application.php.
References Application\$name, and Application\add().
renderException | ( | $e, | |
$output | |||
) |
Renders a caught exception.
\Exception | $e | An exception instance |
OutputInterface | $output | An OutputInterface instance |
Definition at line 672 of file vendor/symfony/console/Application.php.
References Application\getName(), Application\getTerminalWidth(), OutputInterface\OUTPUT_RAW, Application\splitStringByWidth(), and Application\stringWidth().
Referenced by Application\run().
run | ( | InputInterface | $input = null , |
OutputInterface | $output = null |
||
) |
Runs the current application.
\Exception | When doRun returns Exception |
Definition at line 113 of file vendor/symfony/console/Application.php.
References Application\configureIO(), Application\doRun(), and Application\renderException().
setAutoExit | ( | $boolean | ) |
Sets whether to automatically exit after a command execution or not.
bool | $boolean | Whether to automatically exit after a command execution or not |
Definition at line 276 of file vendor/symfony/console/Application.php.
setCatchExceptions | ( | $boolean | ) |
Sets whether to catch exceptions or not during commands execution.
bool | $boolean | Whether to catch exceptions or not during commands execution |
Definition at line 264 of file vendor/symfony/console/Application.php.
setDefaultCommand | ( | $commandName | ) |
Sets the default Command name.
string | $commandName | The Command name |
Definition at line 1100 of file vendor/symfony/console/Application.php.
Referenced by CustomDefaultCommandApplication\__construct().
setDefinition | ( | InputDefinition | $definition | ) |
Set an input definition set to be used with this application.
InputDefinition | $definition | The input definition |
Definition at line 232 of file vendor/symfony/console/Application.php.
References Application\$definition.
setDispatcher | ( | EventDispatcherInterface | $dispatcher | ) |
Definition at line 96 of file vendor/symfony/console/Application.php.
References Application\$dispatcher.
setHelperSet | ( | HelperSet | $helperSet | ) |
Set a helper set to be used with the command.
HelperSet | $helperSet | The helper set |
Definition at line 208 of file vendor/symfony/console/Application.php.
References Application\$helperSet.
setName | ( | $name | ) |
Sets the application name.
string | $name | The application name |
Definition at line 300 of file vendor/symfony/console/Application.php.
References Application\$name.
setTerminalDimensions | ( | $width, | |
$height | |||
) |
Sets terminal dimensions.
Can be useful to force terminal dimensions for functional tests.
int | $width | The width |
int | $height | The height |
Definition at line 812 of file vendor/symfony/console/Application.php.
setVersion | ( | $version | ) |
Sets the application version.
string | $version | The application version |
Definition at line 324 of file vendor/symfony/console/Application.php.
References Application\$version.
|
private |
Definition at line 1118 of file vendor/symfony/console/Application.php.
Referenced by Application\renderException().
|
private |
Definition at line 1105 of file vendor/symfony/console/Application.php.
Referenced by Application\renderException().
|
private |
Definition at line 68 of file vendor/symfony/console/Application.php.
|
private |
Definition at line 67 of file vendor/symfony/console/Application.php.
|
private |
Definition at line 62 of file vendor/symfony/console/Application.php.
Referenced by Application\all(), and Application\find().
|
private |
Definition at line 73 of file vendor/symfony/console/Application.php.
Referenced by Application\doRun().
|
private |
Definition at line 69 of file vendor/symfony/console/Application.php.
Referenced by Application\getDefinition(), and Application\setDefinition().
|
private |
Definition at line 71 of file vendor/symfony/console/Application.php.
Referenced by Application\setDispatcher().
|
private |
Definition at line 70 of file vendor/symfony/console/Application.php.
Referenced by Application\getHelperSet(), and Application\setHelperSet().
|
private |
Definition at line 65 of file vendor/symfony/console/Application.php.
Referenced by Application\__construct(), Application\all(), Application\doRun(), Application\extractAllNamespaces(), Application\extractNamespace(), Application\find(), Application\findAlternatives(), Application\get(), Application\getAbbreviations(), Application\getName(), Application\has(), Application\register(), and Application\setName().
|
private |
Definition at line 64 of file vendor/symfony/console/Application.php.
|
private |
Definition at line 72 of file vendor/symfony/console/Application.php.
Referenced by Application\getTerminalDimensions().
|
private |
Definition at line 66 of file vendor/symfony/console/Application.php.
Referenced by Application\__construct(), Application\getVersion(), and Application\setVersion().
|
private |
Definition at line 63 of file vendor/symfony/console/Application.php.