Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
Request Class Reference

Public Member Functions

 __construct (array $args=null, array $env=null)
 Create a new CLI request.
 
 setParams (Parameters $params)
 Exchange parameters object.
 
 getParams ()
 Return the container responsible for parameters.
 
 getParam ($name, $default=null)
 Return a single parameter.
 
 params ()
 Return the container responsible for parameters.
 
 setEnv (Parameters $env)
 Provide an alternate Parameter Container implementation for env parameters in this object, (this is NOT the primary API for value setting, for that see env())
 
 getEnv ($name, $default=null)
 Return a single parameter container responsible for env parameters.
 
 env ()
 Return the parameter container responsible for env parameters.
 
 toString ()
 
 __toString ()
 Allow PHP casting of this object.
 
 setScriptName ($scriptName)
 
 getScriptName ()
 
- Public Member Functions inherited from Message
 setMetadata ($spec, $value=null)
 Set message metadata.
 
 getMetadata ($key=null, $default=null)
 Retrieve all metadata or a single metadatum as specified by key.
 
 setContent ($value)
 Set message content.
 
 getContent ()
 Get message content.
 
 toString ()
 
- Public Member Functions inherited from MessageInterface
 getMetadata ($key=null)
 Get metadata.
 

Protected Attributes

 $params = null
 
 $envParams = null
 
 $scriptName = null
 
- Protected Attributes inherited from Message
 $metadata = []
 
 $content = ''
 

Constructor & Destructor Documentation

__construct ( array  $args = null,
array  $env = null 
)

Create a new CLI request.

Parameters
array | null$argsConsole arguments. If not supplied, $_SERVER['argv'] will be used
array | null$envEnvironment data. If not supplied, $_ENV will be used
Exceptions
Exception\RuntimeException

Extract first param assuming it is the script name

Store runtime params

Store environment data

Member Function Documentation

__toString ( )

Allow PHP casting of this object.

Returns
string
env ( )

Return the parameter container responsible for env parameters.

Returns
getEnv (   $name,
  $default = null 
)

Return a single parameter container responsible for env parameters.

Parameters
string$nameParameter name
string$default(optional) default value in case the parameter does not exist
Returns
getParam (   $name,
  $default = null 
)

Return a single parameter.

Shortcut for $request->params()->get()

Parameters
string$nameParameter name
string$default(optional) default value in case the parameter does not exist
Returns
mixed
getParams ( )

Return the container responsible for parameters.

Returns
getScriptName ( )
Returns
string
params ( )

Return the container responsible for parameters.

Returns
setEnv ( Parameters  $env)

Provide an alternate Parameter Container implementation for env parameters in this object, (this is NOT the primary API for value setting, for that see env())

Parameters
\Zend\Stdlib\Parameters$env
Returns
setParams ( Parameters  $params)

Exchange parameters object.

Parameters
\Zend\Stdlib\Parameters$params
Returns
Request
setScriptName (   $scriptName)
Parameters
string$scriptName
toString ( )
Returns
string

Member Data Documentation

$envParams = null
protected
$params = null
protected
$scriptName = null
protected