PHP Class PrivateBin\Request

parses request parameters and provides helper functions for routing
Afficher le fichier Open project: privatebin/privatebin

Méthodes publiques

Méthode Description
__construct ( ) : void Constructor.
getOperation ( ) : string Get current operation.
getParam ( string $param, string $default = '' ) : string Get a request parameter.
isJsonApiCall ( ) : boolean If we are in a JSON API context.
setInputStream ( string $input ) Override the default input stream source, used for unit testing.

Private Methods

Méthode Description
_detectJsonRequest ( ) : boolean detect the clients supported media type and decide if its a JSON API call or not

Method Details

__construct() public méthode

Constructor.
public __construct ( ) : void
Résultat void

getOperation() public méthode

Get current operation.
public getOperation ( ) : string
Résultat string

getParam() public méthode

Get a request parameter.
public getParam ( string $param, string $default = '' ) : string
$param string
$default string
Résultat string

isJsonApiCall() public méthode

If we are in a JSON API context.
public isJsonApiCall ( ) : boolean
Résultat boolean

setInputStream() public static méthode

Override the default input stream source, used for unit testing.
public static setInputStream ( string $input )
$input string