MediaWiki
1.34.0
|
Simple Callbacks implementation for $_GET/$_POST/$_FILES data. More...
Public Member Functions | |
__construct (array $params, array $files=[]) | |
clearRecordedConditions () | |
Clear any recorded conditions. More... | |
getRecordedConditions () | |
Fetch any recorded conditions. More... | |
getUploadedFile ( $name, array $options) | |
Fetch data for a file upload. More... | |
getValue ( $name, $default, array $options) | |
Fetch a value from the request. More... | |
hasParam ( $name, array $options) | |
Test if a parameter exists in the request. More... | |
hasUpload ( $name, array $options) | |
Test if a parameter exists as an upload in the request. More... | |
recordCondition (ValidationException $condition, array $options) | |
Record non-fatal conditions. More... | |
useHighLimits (array $options) | |
Indicate whether "high limits" should be used. More... | |
Private Attributes | |
array | $conditions = [] |
Any recorded conditions. More... | |
array UploadedFile[] | $files |
$_FILES data or UploadedFile instances More... | |
string string[][] | $params |
$_GET/$_POST data More... | |
Simple Callbacks implementation for $_GET/$_POST/$_FILES data.
Options array keys used by this class:
Definition at line 16 of file SimpleCallbacks.php.
Wikimedia\ParamValidator\SimpleCallbacks::__construct | ( | array | $params, |
array | $files = [] |
||
) |
(string|string[])[] | $params Data from $_POST + $_GET | |
array[] | $files | Data from $_FILES |
Definition at line 31 of file SimpleCallbacks.php.
References Wikimedia\ParamValidator\SimpleCallbacks\$files, and Wikimedia\ParamValidator\SimpleCallbacks\$params.
Wikimedia\ParamValidator\SimpleCallbacks::clearRecordedConditions | ( | ) |
Clear any recorded conditions.
Definition at line 72 of file SimpleCallbacks.php.
Wikimedia\ParamValidator\SimpleCallbacks::getRecordedConditions | ( | ) |
Fetch any recorded conditions.
Definition at line 65 of file SimpleCallbacks.php.
References Wikimedia\ParamValidator\SimpleCallbacks\$conditions.
Wikimedia\ParamValidator\SimpleCallbacks::getUploadedFile | ( | $name, | |
array | $options | ||
) |
Fetch data for a file upload.
string | $name | Parameter name of the upload |
array | $options | Options array |
Implements Wikimedia\ParamValidator\Callbacks.
Definition at line 48 of file SimpleCallbacks.php.
References $file.
Wikimedia\ParamValidator\SimpleCallbacks::getValue | ( | $name, | |
$default, | |||
array | $options | ||
) |
Fetch a value from the request.
Return $default
for file-upload parameters.
string | $name | Parameter name to fetch |
mixed | $default | Default value to return if the parameter is unset. |
array | $options | Options array |
Implements Wikimedia\ParamValidator\Callbacks.
Definition at line 40 of file SimpleCallbacks.php.
Wikimedia\ParamValidator\SimpleCallbacks::hasParam | ( | $name, | |
array | $options | ||
) |
Test if a parameter exists in the request.
string | $name | Parameter name |
array | $options | Options array |
Implements Wikimedia\ParamValidator\Callbacks.
Definition at line 36 of file SimpleCallbacks.php.
Wikimedia\ParamValidator\SimpleCallbacks::hasUpload | ( | $name, | |
array | $options | ||
) |
Test if a parameter exists as an upload in the request.
string | $name | Parameter name |
array | $options | Options array |
Implements Wikimedia\ParamValidator\Callbacks.
Definition at line 44 of file SimpleCallbacks.php.
Wikimedia\ParamValidator\SimpleCallbacks::recordCondition | ( | ValidationException | $condition, |
array | $options | ||
) |
Record non-fatal conditions.
ValidationException | $condition | |
array | $options | Options array |
Implements Wikimedia\ParamValidator\Callbacks.
Definition at line 57 of file SimpleCallbacks.php.
Wikimedia\ParamValidator\SimpleCallbacks::useHighLimits | ( | array | $options | ) |
Indicate whether "high limits" should be used.
Some settings have multiple limits, one for "normal" users and a higher one for "privileged" users. This is used to determine which class the current user is in when necessary.
array | $options | Options array |
Implements Wikimedia\ParamValidator\Callbacks.
Definition at line 76 of file SimpleCallbacks.php.
|
private |
Any recorded conditions.
Definition at line 25 of file SimpleCallbacks.php.
Referenced by Wikimedia\ParamValidator\SimpleCallbacks\getRecordedConditions().
|
private |
$_FILES data or UploadedFile instances
Definition at line 22 of file SimpleCallbacks.php.
Referenced by Wikimedia\ParamValidator\SimpleCallbacks\__construct().
|
private |
$_GET/$_POST data
Definition at line 19 of file SimpleCallbacks.php.
Referenced by Wikimedia\ParamValidator\SimpleCallbacks\__construct().