class Application extends Application
__construct(KernelInterface $kernel) | ||
setDispatcher(EventDispatcherInterface $dispatcher) | from Application | |
setCommandLoader(CommandLoaderInterface $commandLoader) | from Application | |
int | run(InputInterface $input = null, OutputInterface $output = null) Runs the current application. | from Application |
int | doRun(InputInterface $input, OutputInterface $output) Runs the current application. | |
setHelperSet(HelperSet $helperSet) | from Application | |
HelperSet | getHelperSet() Get the helper set associated with the command. | from Application |
setDefinition(InputDefinition $definition) | from Application | |
InputDefinition | getDefinition() Gets the InputDefinition related to this Application. | from Application |
string | getHelp() Gets the help message. | from Application |
bool | areExceptionsCaught() Gets whether to catch exceptions or not during commands execution. | from Application |
setCatchExceptions(bool $boolean) Sets whether to catch exceptions or not during commands execution. | from Application | |
bool | isAutoExitEnabled() Gets whether to automatically exit after a command execution or not. | from Application |
setAutoExit(bool $boolean) Sets whether to automatically exit after a command execution or not. | from Application | |
string | getName() Gets the name of the application. | from Application |
setName(string $name) Sets the application name. | from Application | |
string | getVersion() Gets the application version. | from Application |
setVersion(string $version) Sets the application version. | from Application | |
string | getLongVersion() Returns the long version of the application. | |
Command | register(string $name) Registers a new command. | from Application |
addCommands(array $commands) Adds an array of command objects. | from Application | |
Command|null | add(Command $command) Adds a command object. | |
Command | get(string $name) Returns a registered command by name or alias. | |
bool | has(string $name) Returns true if the command exists, false otherwise. | from Application |
string[] | getNamespaces() Returns an array of all unique namespaces used by currently registered commands. | from Application |
string | findNamespace(string $namespace) Finds a registered namespace by a name or an abbreviation. | from Application |
Command | find(string $name) Finds a command by name or alias. | |
Command[] | all(string $namespace = null) Gets the commands (registered in the given namespace if provided). | |
static array | getAbbreviations(array $names) Returns an array of possible abbreviations given a set of names. | from Application |
renderException(Exception $e, OutputInterface $output) Renders a caught exception. | from Application | |
doRenderException(Exception $e, OutputInterface $output) | from Application | |
configureIO(InputInterface $input, OutputInterface $output) Configures the input and output instances based on the user arguments and options. | from Application | |
int | doRunCommand(Command $command, InputInterface $input, OutputInterface $output) Runs the current command. | |
string | getCommandName(InputInterface $input) Gets the name of the command based on input. | from Application |
InputDefinition | getDefaultInputDefinition() Gets the default input definition. | from Application |
Command[] | getDefaultCommands() Gets the default commands that should always be available. | from Application |
HelperSet | getDefaultHelperSet() Gets the default helper set with the helpers that should always be available. | from Application |
string | extractNamespace(string $name, string $limit = null) Returns the namespace part of the command name. | from Application |
Application | setDefaultCommand(string $commandName, bool $isSingleCommand = false) Sets the default Command name. | from Application |
KernelInterface | getKernel() Gets the Kernel associated with this Console. | |
registerCommands() |
KernelInterface | $kernel |
EventDispatcherInterface | $dispatcher |
CommandLoaderInterface | $commandLoader |
Runs the current application.
InputInterface | $input | |
OutputInterface | $output |
int | 0 if everything went fine, or an error code |
Exception | When running fails. Bypass this when {@link setCatchExceptions()}. |
Runs the current application.
InputInterface | $input | |
OutputInterface | $output |
int | 0 if everything went fine, or an error code |
HelperSet | $helperSet |
Get the helper set associated with the command.
HelperSet | The HelperSet instance associated with this command |
InputDefinition | $definition |
Gets the InputDefinition related to this Application.
InputDefinition | The InputDefinition instance |
Gets the help message.
string | A help message |
Gets whether to catch exceptions or not during commands execution.
bool | Whether to catch exceptions or not during commands execution |
Sets whether to catch exceptions or not during commands execution.
bool | $boolean | Whether to catch exceptions or not during commands execution |
Gets whether to automatically exit after a command execution or not.
bool | Whether to automatically exit after a command execution or not |
Sets whether to automatically exit after a command execution or not.
bool | $boolean | Whether to automatically exit after a command execution or not |
Gets the name of the application.
string | The application name |
Sets the application name.
string | $name | The application name |
Gets the application version.
string | The application version |
Sets the application version.
string | $version | The application version |
Returns the long version of the application.
string | The long application version |
Registers a new command.
string | $name | The command name |
Command | The newly created command |
Adds an array of command objects.
If a Command is not enabled it will not be added.
array | $commands | An array of commands |
Adds a command object.
If a command with the same name already exists, it will be overridden. If the command is not enabled it will not be added.
Command | $command |
Command|null | The registered command if enabled or null |
Returns a registered command by name or alias.
string | $name | The command name or alias |
Command | A Command object |
CommandNotFoundException | When given command name does not exist |
Returns true if the command exists, false otherwise.
string | $name | The command name or alias |
bool | true if the command exists, false otherwise |
Returns an array of all unique namespaces used by currently registered commands.
It does not return the global namespace which always exists.
string[] | An array of namespaces |
Finds a registered namespace by a name or an abbreviation.
string | $namespace | A namespace or abbreviation to search for |
string | A registered namespace |
NamespaceNotFoundException | When namespace is incorrect or ambiguous |
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 |
Command | A Command instance |
CommandNotFoundException | When command name is incorrect or ambiguous |
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 |
Command[] | An array of Command instances |
Returns an array of possible abbreviations given a set of names.
array | $names | An array of names |
array | An array of abbreviations |
Renders a caught exception.
Exception | $e | |
OutputInterface | $output |
Exception | $e | |
OutputInterface | $output |
Configures the input and output instances based on the user arguments and options.
InputInterface | $input | |
OutputInterface | $output |
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 | |
InputInterface | $input | |
OutputInterface | $output |
int | 0 if everything went fine, or an error code |
Gets the name of the command based on input.
InputInterface | $input |
string | The command name |
Gets the default input definition.
InputDefinition | An InputDefinition instance |
Gets the default commands that should always be available.
Command[] | An array of default Command instances |
Gets the default helper set with the helpers that should always be available.
HelperSet | A HelperSet instance |
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 |
string | The namespace of the command |
Sets the default Command name.
string | $commandName | The Command name |
bool | $isSingleCommand | Set to true if there is only one command in this application |
Application |
Gets the Kernel associated with this Console.
KernelInterface | A KernelInterface instance |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/FrameworkBundle/Console/Application.html