ConfigCommand
class ConfigCommand extends Command (View source)
Constants
RETURN_CODE_ON_FAILURE |
The return code we should return when an exception is thrown while running the command. |
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. |
Properties
protected InputInterface | $input | from Command | |
protected OutputStyle | $output | from Command | |
protected string | $name | from Command | |
protected | $description | ||
$hidden | from Command | ||
protected | $signature | ||
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 |
protected Repository | $repository |
Methods
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
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.
No description
No description
No description
Complete a requested get action.
Details
__construct($name = null)
No description
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.
run(InputInterface $input, OutputInterface $output)
{@inheritdoc}
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 mixed
execute(InputInterface $input, OutputInterface $output)
This method is overridden to pipe execution to the handle method hiding input and output
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()
No description
handle(Repository $config, Filesystem $filesystem)
No description
protected
configure()
No description
protected string
serialize(mixed $value)
No description
protected mixed
unserialize(string $value)
No description
private
doGetAction($repository, $item)
Complete a requested get action.
private
doSetAction(Repository $repository, string $item)
Complete a requested set action.
private Repository
getRepository(Repository $config, Filesystem $filesystem)
No description