class DrushArgvInput extends ArgvInput (View source)

ArgvInput represents an input coming from the CLI arguments.

Usage:

$input = new ArgvInput();

By default, the $_SERVER['argv'] array is used for the input values.

This can be overridden by explicitly passing the input values in the constructor:

$input = new ArgvInput($_SERVER['argv']);

If you pass it yourself, don't forget that the first element of the array is the name of the running application.

When passing an argument to the constructor, be sure that it respects the same rules as the argv one. It's almost always better to use the StringInput when you want to provide your own input.

Methods

__construct(array $argv = null, InputDefinition $definition = null)

No description

setTokens(array $tokens)

No description

parse()

{@inheritdoc}

getFirstArgument()

{@inheritdoc}

hasParameterOption($values, $onlyParams = false)

{@inheritdoc}

getParameterOption($values, $default = false, $onlyParams = false)

{@inheritdoc}

string
__toString()

Returns a stringified representation of the args passed to the command.

Details

__construct(array $argv = null, InputDefinition $definition = null)

Parameters

array $argv An array of parameters from the CLI (in the argv format)
InputDefinition $definition A InputDefinition instance

protected setTokens(array $tokens)

Parameters

array $tokens

protected parse()

{@inheritdoc}

getFirstArgument()

{@inheritdoc}

hasParameterOption($values, $onlyParams = false)

{@inheritdoc}

Parameters

$values
$onlyParams

getParameterOption($values, $default = false, $onlyParams = false)

{@inheritdoc}

Parameters

$values
$default
$onlyParams

string __toString()

Returns a stringified representation of the args passed to the command.

Return Value

string