implements |
ResetInterface |
---|
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();
Methods | ||
---|---|---|
public
|
__construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
|
# |
public
|
setDispatcher(EventDispatcherInterface $dispatcher)
|
# |
public
|
setCommandLoader(CommandLoaderInterface $commandLoader)
|
# |
public
|
getSignalRegistry(): SignalRegistry
|
# |
public
|
setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
|
# |
public
|
run(InputInterface $input = null, OutputInterface $output = null): int
|
# |
public
|
doRun(InputInterface $input, OutputInterface $output): int
|
# |
public
|
reset()
|
# |
public
|
setHelperSet(HelperSet $helperSet)
|
# |
public
|
getHelperSet(): HelperSet
|
# |
public
|
setDefinition(InputDefinition $definition)
|
# |
public
|
getDefinition(): InputDefinition
|
# |
public
|
complete(CompletionInput $input, CompletionSuggestions $suggestions): void
|
# |
public
|
getHelp(): string
|
# |
public
|
areExceptionsCaught(): bool
|
# |
public
|
setCatchExceptions(bool $boolean)
|
# |
public
|
isAutoExitEnabled(): bool
|
# |
public
|
setAutoExit(bool $boolean)
|
# |
public
|
getName(): string
|
# |
public
|
setName(string $name)
|
# |
public
|
getVersion(): string
|
# |
public
|
setVersion(string $version)
|
# |
public
|
getLongVersion(): string
|
# |
public
|
register(string $name): Command
|
# |
public
|
addCommands(Command[] $commands)
|
# |
public
|
add(Command $command): Command|null
|
# |
public
|
get(string $name): Command
|
# |
public
|
has(string $name): bool
|
# |
public
|
getNamespaces(): string[]
|
# |
public
|
findNamespace(string $namespace): string
|
# |
public
|
find(string $name): Command
|
# |
public
|
all(string $namespace = null): Command[]
|
# |
public
static
|
getAbbreviations(array $names): string[][]
|
# |
public
|
renderThrowable(Throwable $e, OutputInterface $output): void
|
# |
public
|
extractNamespace(string $name, int $limit = null): string
|
# |
public
|
setDefaultCommand(string $commandName, bool $isSingleCommand = false): $this
|
# |