Application
class Application extends Application
Application.
Methods
Set an input definition set to be used with this application.
Gets the InputDefinition related to this Application.
Sets whether to catch exceptions or not during commands execution.
Sets whether to automatically exit after a command execution or not.
Returns an array of all unique namespaces used by currently registered commands.
Finds a registered namespace by a name or an abbreviation.
Gets the commands (registered in the given namespace if provided).
Returns an array of possible abbreviations given a set of names.
Tries to figure out the terminal dimensions based on the current environment.
Sets terminal dimensions.
Returns the namespace part of the command name.
Gets the Kernel associated with this Console.
Details
at line line 38
__construct(KernelInterface $kernel)
Constructor.
in Application at line line 89
setDispatcher(EventDispatcherInterface $dispatcher)
in Application at line line 104
int
run(InputInterface $input = null, OutputInterface $output = null)
Runs the current application.
at line line 66
int
doRun(InputInterface $input, OutputInterface $output)
Runs the current application.
in Application at line line 197
setHelperSet(HelperSet $helperSet)
Set a helper set to be used with the command.
in Application at line line 207
HelperSet
getHelperSet()
Get the helper set associated with the command.
in Application at line line 217
setDefinition(InputDefinition $definition)
Set an input definition set to be used with this application.
in Application at line line 227
InputDefinition
getDefinition()
Gets the InputDefinition related to this Application.
in Application at line line 237
string
getHelp()
Gets the help message.
in Application at line line 247
setCatchExceptions(bool $boolean)
Sets whether to catch exceptions or not during commands execution.
in Application at line line 257
setAutoExit(bool $boolean)
Sets whether to automatically exit after a command execution or not.
in Application at line line 267
string
getName()
Gets the name of the application.
in Application at line line 277
setName(string $name)
Sets the application name.
in Application at line line 287
string
getVersion()
Gets the application version.
in Application at line line 297
setVersion(string $version)
Sets the application version.
in Application at line line 307
string
getLongVersion()
Returns the long version of the application.
in Application at line line 323
Command
register(string $name)
Registers a new command.
in Application at line line 333
addCommands(array $commands)
Adds an array of command objects.
in Application at line line 349
Command
add(Command $command)
Adds a command object.
If a command with the same name already exists, it will be overridden.
in Application at line line 381
Command
get(string $name)
Returns a registered command by name or alias.
in Application at line line 408
bool
has(string $name)
Returns true if the command exists, false otherwise.
in Application at line line 420
array
getNamespaces()
Returns an array of all unique namespaces used by currently registered commands.
It does not returns the global namespace which always exists.
in Application at line line 443
string
findNamespace(string $namespace)
Finds a registered namespace by a name or an abbreviation.
in Application at line line 485
Command
find(string $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.
in Application at line line 540
Command[]
all(string $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.
in Application at line line 563
static array
getAbbreviations(array $names)
Returns an array of possible abbreviations given a set of names.
in Application at line line 582
renderException(Exception $e, OutputInterface $output)
Renders a caught exception.
in Application at line line 681
array
getTerminalDimensions()
Tries to figure out the terminal dimensions based on the current environment.
in Application at line line 722
Application
setTerminalDimensions(int $width, int $height)
Sets terminal dimensions.
Can be useful to force terminal dimensions for functional tests.
in Application at line line 953
string
extractNamespace(string $name, string $limit = null)
Returns the namespace part of the command name.
This method is not part of public API and should not be used directly.
in Application at line line 1017
setDefaultCommand(string $commandName)
Sets the default Command name.
at line line 53
KernelInterface
getKernel()
Gets the Kernel associated with this Console.