PHP Class PrivateBin\Request

parses request parameters and provides helper functions for routing
ファイルを表示 Open project: privatebin/privatebin

Public Methods

Method 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

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

Method Details

__construct() public method

Constructor.
public __construct ( ) : void
return void

getOperation() public method

Get current operation.
public getOperation ( ) : string
return string

getParam() public method

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

isJsonApiCall() public method

If we are in a JSON API context.
public isJsonApiCall ( ) : boolean
return boolean

setInputStream() public static method

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