Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ArgvInput
  • ArrayInput
  • Input
  • InputArgument
  • InputDefinition
  • InputOption
  • StringInput

Interfaces

  • InputInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class 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.

Symfony\Component\Console\Input\Input implements Symfony\Component\Console\Input\InputInterface
Extended by Symfony\Component\Console\Input\ArgvInput

Direct known subclasses

Symfony\Component\Console\Input\StringInput
Namespace: Symfony\Component\Console\Input
Author: Fabien Potencier <fabien@symfony.com>
See: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
See: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
Api
Located at console/Symfony/Component/Console/Input/ArgvInput.php
Methods summary
public
# __construct( array $argv = null, Symfony\Component\Console\Input\InputDefinition $definition = null )

Constructor.

Constructor.

Parameters

$argv
array
$argv An array of parameters from the CLI (in the argv format)
$definition
Symfony\Component\Console\Input\InputDefinition
$definition A InputDefinition instance

Api

Overrides

Symfony\Component\Console\Input\Input::__construct()
protected
# setTokens( array $tokens )
protected
# parse( )

Processes command line arguments.

Processes command line arguments.

public string
# getFirstArgument( )

Returns the first argument from the raw parameters (not parsed).

Returns the first argument from the raw parameters (not parsed).

Returns

string
The value of the first argument or null otherwise
public Boolean
# hasParameterOption( string|array $values )

Returns true if the raw parameters (not parsed) contain a value.

Returns true if the raw parameters (not parsed) contain a value.

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully.

Parameters

$values
string|array
$values The value(s) to look for in the raw parameters (can be an array)

Returns

Boolean
true if the value is contained in the raw parameters
public mixed
# getParameterOption( string|array $values, mixed $default = false )

Returns the value of a raw option (not parsed).

Returns the value of a raw option (not parsed).

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully.

Parameters

$values
string|array
$values The value(s) to look for in the raw parameters (can be an array)
$default
mixed
$default The default value to return if no result is found

Returns

mixed
The option value
Methods inherited from Symfony\Component\Console\Input\Input
bind(), getArgument(), getArguments(), getOption(), getOptions(), hasArgument(), hasOption(), isInteractive(), setArgument(), setInteractive(), setOption(), validate()
Properties inherited from Symfony\Component\Console\Input\Input
$arguments, $definition, $interactive, $options
php-coveralls API documentation generated by ApiGen 2.8.0