class Input

An abstracted Input object gathered from an interface

An Input object describes the app and action to be run, as well as any input parameters or files, or basic authentication

Constants

LoggerKey

Properties

private $app
private $action
private $auth
private $params
private $files

Methods

string
GetApp()

The app to be run

string
GetAction()

The app action to be run

InputAuth|null
GetAuth()

The basic authentication to be used

SetLogger(BaseAppLog|null $logger)

Sets the optional param logger to the given BaseAppLog

GetParams()

The inner collection of parameters to be used

bool
HasParam(string $key)

No description

AddParam(string $key, $value)

No description

GetParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

GetOptParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

GetNullParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

GetOptNullParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

array
GetFiles()

Returns the array of input files

bool
HasFile(string $key)

Determines whether or not the given key exists as an input file

AddFile(string $key, InputStream $file)

Adds the given InputStream to the file array

GetFile(string $key)

Gets the file mapped to the parameter name

InputStream|null
TryGetFile(string $key)

Same as GetFile() but returns null rather than throwing an exception

__construct(string $app, string $action, SafeParams|null $params = null, array|null $files = null, InputAuth|null $auth = null)

Constructs an input object using the data gathered from the interface, and sanitizes the app/action strings

Details

at line 36
string GetApp()

The app to be run

Return Value

string

at line 42
string GetAction()

The app action to be run

Return Value

string

at line 48
InputAuth|null GetAuth()

The basic authentication to be used

Return Value

InputAuth|null

at line 53
Input SetLogger(BaseAppLog|null $logger)

Sets the optional param logger to the given BaseAppLog

Parameters

BaseAppLog|null $logger

Return Value

Input

at line 71
SafeParams GetParams()

The inner collection of parameters to be used

Return Value

SafeParams

at line 74
bool HasParam(string $key)

No description

Parameters

string $key

Return Value

bool

See also

SafeParams::HasParam

at line 78
Input AddParam(string $key, $value)

No description

Parameters

string $key
$value

Return Value

Input

See also

SafeParams::AddParam

at line 82
GetParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

Parameters

string $key
int $type
int $minlog
array|null $values
callable|null $valfunc

See also

SafeParams::GetParam

at line 86
GetOptParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

Parameters

string $key
int $type
int $minlog
array|null $values
callable|null $valfunc

See also

SafeParams::GetOptParam

at line 90
GetNullParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

Parameters

string $key
int $type
int $minlog
array|null $values
callable|null $valfunc

See also

SafeParams::GetNullParam

at line 94
GetOptNullParam(string $key, int $type, int $minlog = SafeParams::PARAMLOG_ONLYFULL, array|null $values = null, callable|null $valfunc = null)

No description

Parameters

string $key
int $type
int $minlog
array|null $values
callable|null $valfunc

See also

SafeParams::GetOptNullParam

at line 101
array GetFiles()

Returns the array of input files

Return Value

array

at line 108
bool HasFile(string $key)

Determines whether or not the given key exists as an input file

Parameters

string $key

the parameter name to check for

Return Value

bool

true if the param exists as an input file

at line 117
Input AddFile(string $key, InputStream $file)

Adds the given InputStream to the file array

Parameters

string $key

param name for file

InputStream $file

input file stream

Return Value

Input

at line 126
InputStream GetFile(string $key)

Gets the file mapped to the parameter name

Parameters

string $key

the parameter key name

Return Value

InputStream

the uploaded file

Exceptions

SafeParamKeyMissingException

if the key does not exist

at line 137
InputStream|null TryGetFile(string $key)

Same as GetFile() but returns null rather than throwing an exception

Parameters

string $key

Return Value

InputStream|null

See also

Input::GetFile

at line 144
__construct(string $app, string $action, SafeParams|null $params = null, array|null $files = null, InputAuth|null $auth = null)

Constructs an input object using the data gathered from the interface, and sanitizes the app/action strings

Parameters

string $app
string $action
SafeParams|null $params
array|null $files
InputAuth|null $auth