InstallCommand
class InstallCommand extends Command (View source)
Constants
deprecated RETURN_CODE_ON_SUCCESS |
|
deprecated RETURN_CODE_ON_FAILURE |
|
INVALID |
Concrete requires symfony/console ^5.2, and the INVALID constant has been introduced in symfony/console 5.3.0 |
ALLOWASROOT_OPTION |
The name of the CLI option that allows running CLI commands as root without confirmation. |
ALLOWASROOT_ENV |
The name of the environment variable that allows running CLI commands as root without confirmation. |
private OPTIONPRECONDITIONS_ERROR |
|
private OPTIONPRECONDITIONS_WARNINGS |
|
private OPTIONPRECONDITIONS_SUCCESS |
|
Properties
protected InputInterface | $input | from Command | |
protected OutputStyle | $output | from Command | |
protected string | $name | from Command | |
protected string | $description | from Command | |
$hidden | from Command | ||
protected string | $signature | The command signature. |
from Command |
protected bool | $canRunAsRoot | Can this command be executed as root? If set to false, the command can be executed if one of these conditions is satisfied:
|
from Command |
private bool|null | $preconditionsPassed | ||
private Installer|null | $configuredInstaller |
Methods
Call another console command silently.
Confirm a question with the user.
Prompt the user for input with auto completion.
Prompt the user for input but hide the answer from the console.
Give the user a single choice from an array of answers.
Format input to textual table.
Configure the console command using a fluent definition.
Allow/disallow running this command as root without confirmation.
This method is overridden to pipe execution to the handle method hiding input and output.
No description
No description
Do some procedural work to a row in the wizard step list to turn it into a proper question.
A wizard generator.
Take an option and return a question string.
An array of steps Items: [ "option-name", "default-value", function($question, $input, $option) : $question ].
No description
No description
No description
Details
__construct($name = null)
No description
run(InputInterface $input, OutputInterface $output)
{@inheritdoc}
int
call(string $command, array $arguments = [])
Call another console command.
int
callSilent(string $command, array $arguments = [])
Call another console command silently.
bool
hasArgument(string|int $name)
Determine if the given argument is present.
string|array
argument(string|null $key = null)
Get the value of a command argument.
array
arguments()
Get all of the arguments passed to the command.
bool
hasOption(string $name)
Determine if the given option is present.
string|array
option(string $key = null)
Get the value of a command option.
array
options()
Get all of the options passed to the command.
bool
confirm(string $question, bool $default = false)
Confirm a question with the user.
string
ask(string $question, string $default = null)
Prompt the user for input.
string
askWithCompletion(string $question, array $choices, string $default = null, null $attempts = null, null $strict = null)
Prompt the user for input with auto completion.
string
secret(string $question, bool $fallback = true)
Prompt the user for input but hide the answer from the console.
string
choice(string $question, array $choices, string $default = null, mixed $attempts = null, bool $multiple = null)
Give the user a single choice from an array of answers.
void
table(array $headers, array $rows, string $tableStyle = 'default', array $columnStyles = [])
Format input to textual table.
Application|Application
getApplication()
{@inheritdoc}
protected void
configureUsingFluentDefinition()
Configure the console command using a fluent definition.
protected void
specifyParameters()
Specify the arguments and options on the command.
protected array
getArguments()
Get the arguments for this command.
If $this->signature is specified, this method has no effect.
protected array
getOptions()
Get the options for this command.
If $this->signature is specified, this method has no effect.
protected
initialize(InputInterface $input, OutputInterface $output)
{@inheritdoc}
protected
writeError(OutputInterface $output, Exception|Throwable $error)
deprecated
deprecated
Write an exception.
protected Command
addEnvOption()
Add the "env" option to the command options.
protected $this
setCanRunAsRoot(bool $canRunAsRoot)
Allow/disallow running this command as root without confirmation.
protected bool|null
isRunningAsRoot()
Is the current user root?
protected
confirmRunningAsRoot(InputInterface $input, OutputInterface $output)
No description
protected int
execute(InputInterface $input, OutputInterface $output)
This method is overridden to pipe execution to the handle method hiding input and output.
protected
configure()
No description
protected
interact(InputInterface $input, OutputInterface $output)
No description
private Question
getQuestion($row, InputInterface $input)
Do some procedural work to a row in the wizard step list to turn it into a proper question.
private Generator|Question[]
getWizard(InputInterface $input, OutputInterface $output, null $firstKey = null)
A wizard generator.
private string
getQuestionString(InputOption $option, $default)
Take an option and return a question string.
private array
wizardSteps()
An array of steps Items: [ "option-name", "default-value", function($question, $input, $option) : $question ].
private
getPreconditionsPassed(Application $app, OutputInterface $output)
No description
private bool
checkPreconditions(Application $app, OutputInterface $output)
No description
private array
getFinalOptions(InputInterface $input)
No description
private Installer
buildInstaller(array $options)
No description
private int
checkOptionPreconditions(Application $app, Installer $installer, InputInterface $input, OutputInterface $output)
No description