MediaWiki REL1_39
|
Object to access the $_FILES array. More...
Public Member Functions | |
__construct ( $request, $key) | |
Constructor. | |
exists () | |
Return whether a file with this name was uploaded. | |
getError () | |
Return the upload error. | |
getName () | |
Return the original filename of the uploaded file. | |
getSize () | |
Return the file size of the uploaded file. | |
getTempName () | |
Return the path to the temporary file. | |
getType () | |
Return the client specified content type. | |
isIniSizeOverflow () | |
Returns whether this upload failed because of overflow of a maximum set in php.ini. | |
Public Attributes | |
const | REQUIRED_FILEINFO_KEYS = [ 'name', 'size', 'tmp_name', 'type', 'error', ] |
All keys a fileinfo has to specific to work with this class. | |
Protected Attributes | |
bool | $doesExist |
array null | $fileInfo |
WebRequest | $request |
Object to access the $_FILES array.
Definition at line 33 of file WebRequestUpload.php.
WebRequestUpload::__construct | ( | $request, | |
$key ) |
Constructor.
Should only be called by WebRequest
WebRequest | $request | The associated request |
string | $key | Key in $_FILES array (name of form field) |
Definition at line 49 of file WebRequestUpload.php.
References $request.
WebRequestUpload::exists | ( | ) |
Return whether a file with this name was uploaded.
Definition at line 62 of file WebRequestUpload.php.
References $doesExist.
Referenced by getError(), getName(), getSize(), getTempName(), and getType().
WebRequestUpload::getError | ( | ) |
Return the upload error.
See link for explanation https://www.php.net/manual/en/features.file-upload.errors.php
Definition at line 137 of file WebRequestUpload.php.
References exists().
Referenced by isIniSizeOverflow().
WebRequestUpload::getName | ( | ) |
Return the original filename of the uploaded file.
Definition at line 71 of file WebRequestUpload.php.
WebRequestUpload::getSize | ( | ) |
Return the file size of the uploaded file.
Definition at line 93 of file WebRequestUpload.php.
References exists().
WebRequestUpload::getTempName | ( | ) |
Return the path to the temporary file.
Definition at line 107 of file WebRequestUpload.php.
References exists().
WebRequestUpload::getType | ( | ) |
Return the client specified content type.
Definition at line 122 of file WebRequestUpload.php.
References exists().
WebRequestUpload::isIniSizeOverflow | ( | ) |
Returns whether this upload failed because of overflow of a maximum set in php.ini.
Definition at line 152 of file WebRequestUpload.php.
References getError(), and wfShorthandToInteger().
|
protected |
Definition at line 39 of file WebRequestUpload.php.
Referenced by exists().
|
protected |
Definition at line 41 of file WebRequestUpload.php.
|
protected |
Definition at line 37 of file WebRequestUpload.php.
Referenced by FauxRequestUpload\__construct(), and __construct().
const WebRequestUpload::REQUIRED_FILEINFO_KEYS = [ 'name', 'size', 'tmp_name', 'type', 'error', ] |
All keys a fileinfo has to specific to work with this class.
Definition at line 35 of file WebRequestUpload.php.
Referenced by FauxRequest\setUpload().