ServerStartCommand
class ServerStartCommand extends Command
Runs a local web server in a background process.
Properties
static protected | $defaultName |
Methods
No description
Checks whether the command is enabled or not in the current environment.
Configures the current command.
Initializes the command after the input has been bound and before the input is validated.
Merges the application definition with the command definition.
Gets the InputDefinition to be used to create representations of this Command.
Adds an argument.
Adds an option.
Returns the processed help for the command replacing the %command.name% and %command.full_name% patterns with the real values dynamically.
Details
in Command at line 56
static string|null
getDefaultName()
at line 37
__construct(string $documentRoot = null, string $environment = null)
in Command at line 85
ignoreValidationErrors()
Ignores validation errors.
This is mainly useful for the help command.
in Command at line 90
setApplication(Application $application = null)
in Command at line 120
Application
getApplication()
Gets the application instance for this command.
in Command at line 133
bool
isEnabled()
Checks whether the command is enabled or not in the current environment.
Override this to check for x or y and return false if the command can not run properly under the current conditions.
at line 48
protected
configure()
Configures the current command.
at line 89
protected int|null
execute(InputInterface $input, OutputInterface $output)
Executes the current command.
This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method.
in Command at line 171
protected
interact(InputInterface $input, OutputInterface $output)
Interacts with the user.
This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments.
in Command at line 185
protected
initialize(InputInterface $input, OutputInterface $output)
Initializes the command after the input has been bound and before the input is validated.
This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options.
in Command at line 203
int
run(InputInterface $input, OutputInterface $output)
Runs the command.
The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class.
in Command at line 275
$this
setCode(callable $code)
Sets the code to execute when running this command.
If this method is used, it overrides the code defined in the execute() method.
in Command at line 296
mergeApplicationDefinition(bool $mergeArgs = true)
Merges the application definition with the command definition.
This method is not part of public API and should not be used directly.
in Command at line 322
$this
setDefinition(array|InputDefinition $definition)
Sets an array of argument and option instances.
in Command at line 340
InputDefinition
getDefinition()
Gets the InputDefinition attached to this Command.
in Command at line 355
InputDefinition
getNativeDefinition()
Gets the InputDefinition to be used to create representations of this Command.
Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition.
This method is not part of public API and should not be used directly.
in Command at line 372
$this
addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null)
Adds an argument.
in Command at line 392
$this
addOption(string $name, string|array|null $shortcut = null, int|null $mode = null, string $description = '', string|string[]|int|bool|null $default = null)
Adds an option.
in Command at line 413
$this
setName(string $name)
Sets the name of the command.
This method can set both the namespace and the name if you separate them by a colon (:)
$command->setName('foo:bar');
in Command at line 434
$this
setProcessTitle(string $title)
Sets the process title of the command.
This feature should be used only when creating a long process command, like a daemon.
PHP 5.5+ or the proctitle PECL library is required
in Command at line 446
string
getName()
Returns the command name.
in Command at line 466
bool
isHidden()
in Command at line 478
$this
setDescription(string $description)
Sets the description for the command.
in Command at line 490
string
getDescription()
Returns the description for the command.
in Command at line 502
$this
setHelp(string $help)
Sets the help for the command.
in Command at line 514
string
getHelp()
Returns the help for the command.
in Command at line 525
string
getProcessedHelp()
Returns the processed help for the command replacing the %command.name% and %command.full_name% patterns with the real values dynamically.
in Command at line 551
$this
setAliases(string[] $aliases)
Sets the aliases for the command.
in Command at line 571
array
getAliases()
Returns the aliases for the command.
in Command at line 583
string
getSynopsis(bool $short = false)
Returns the synopsis for the command.
in Command at line 601
$this
addUsage(string $usage)
Add a command usage example.
in Command at line 617
array
getUsages()
Returns alternative usages of the command.
in Command at line 632
mixed
getHelper(string $name)
Gets a helper instance by name.