Symfony\Component\Console\Input\ArgvInput
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.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class ArgvInput
extends Input
{
- // Inherited members from Input
- protected $definition;
- protected $options;
- protected $arguments;
- protected $interactive;
- // methods
- public void __construct()
- protected void setTokens()
- protected void parse()
- private void parseShortOption()
- private void parseShortOptionSet()
- private void parseLongOption()
- private void parseArgument()
- private void addShortOption()
- private void addLongOption()
- public string getFirstArgument()
- public Boolean hasParameterOption()
- public mixed getParameterOption()
- public string __toString()
- // Inherited methods from Input
- public void __construct()
- public void bind()
- protected abstract void parse()
- public void validate()
- public Boolean isInteractive()
- public void setInteractive()
- public array getArguments()
- public mixed getArgument()
- public void setArgument()
- public Boolean hasArgument()
- public array getOptions()
- public mixed getOption()
- public void setOption()
- public Boolean hasOption()
- public string escapeToken()
Hierarchy
Extends
Extended by
Members
private
- $parsed
- $tokens
protected
- $arguments
- $definition
- $interactive
- $options
Methods
private
- addLongOption() — Adds a long option value.
- addShortOption() — Adds a short option value.
- parseArgument() — Parses an argument.
- parseLongOption() — Parses a long option.
- parseShortOption() — Parses a short option.
- parseShortOptionSet() — Parses a short option set.
protected
- parse() — Processes command line arguments.
- setTokens()
public
- __construct() — Constructor.
- __toString() — Returns a stringified representation of the args passed to the command
- getFirstArgument() — Returns the first argument from the raw parameters (not parsed).
- getParameterOption() — Returns the value of a raw option (not parsed).
- hasParameterOption() — Returns true if the raw parameters (not parsed) contain a value.
Inherited from Symfony\Component\Console\Input\Input
protected
- parse() — Processes command line arguments.
public
- bind() — Binds the current Input instance with the given arguments and options.
- escapeToken() — Escapes a token through escapeshellarg if it contains unsafe chars
- getArgument() — Returns the argument value for a given argument name.
- getArguments() — Returns the argument values.
- getOption() — Returns the option value for a given option name.
- getOptions() — Returns the options values.
- hasArgument() — Returns true if an InputArgument object exists by name or position.
- hasOption() — Returns true if an InputOption object exists by name.
- isInteractive() — Checks if the input is interactive.
- setArgument() — Sets an argument value by name.
- setInteractive() — Sets the input interactivity.
- setOption() — Sets an option value by name.
- validate() — Validates the input.