class CLIRequestBuilder extends HTTPRequestBuilder (View source)

CLI specific request building logic

Methods

public static 
createFromEnvironment()

Create HTTPRequest instance from the current environment variables.

public static 
createFromVariables(array $variables, string $input, string|null $url = null)

No description

public static 
array
extractRequestHeaders(array $server)

Takes a $_SERVER data array and extracts HTTP request headers.

public static 
array
cleanEnvironment(array $variables)

Clean up HTTP global vars for $_GET / $_REQUEST prior to bootstrapping

Details

static HTTPRequest createFromEnvironment()

Create HTTPRequest instance from the current environment variables.

May throw errors if request is invalid.

Return Value

HTTPRequest

Exceptions

HTTPResponse_Exception

static HTTPRequest createFromVariables(array $variables, string $input, string|null $url = null)

No description

Parameters

array $variables
string $input

Request body

string|null $url

Provide specific url (relative to base)

Return Value

HTTPRequest

static array extractRequestHeaders(array $server)

Takes a $_SERVER data array and extracts HTTP request headers.

Parameters

array $server

Return Value

array

static array cleanEnvironment(array $variables)

Clean up HTTP global vars for $_GET / $_REQUEST prior to bootstrapping

Parameters

array $variables

Return Value

array

Cleaned variables