MediaWiki master
|
Object to access the $_FILES array. More...
Inherited by MediaWiki\Request\FauxRequestUpload.
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 36 of file WebRequestUpload.php.
MediaWiki\Request\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 52 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\$request.
MediaWiki\Request\WebRequestUpload::exists | ( | ) |
Return whether a file with this name was uploaded.
Definition at line 65 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\$doesExist.
Referenced by MediaWiki\Request\WebRequestUpload\getError(), MediaWiki\Request\WebRequestUpload\getName(), MediaWiki\Request\WebRequestUpload\getSize(), MediaWiki\Request\WebRequestUpload\getTempName(), and MediaWiki\Request\WebRequestUpload\getType().
MediaWiki\Request\WebRequestUpload::getError | ( | ) |
Return the upload error.
See link for explanation https://www.php.net/manual/en/features.file-upload.errors.php
Definition at line 140 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\exists().
Referenced by MediaWiki\Request\WebRequestUpload\isIniSizeOverflow().
MediaWiki\Request\WebRequestUpload::getName | ( | ) |
Return the original filename of the uploaded file.
Definition at line 74 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\exists(), MediaWiki\MediaWikiServices\getInstance(), and wfDebug().
MediaWiki\Request\WebRequestUpload::getSize | ( | ) |
Return the file size of the uploaded file.
Definition at line 96 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\exists().
MediaWiki\Request\WebRequestUpload::getTempName | ( | ) |
Return the path to the temporary file.
Definition at line 110 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\exists().
MediaWiki\Request\WebRequestUpload::getType | ( | ) |
Return the client specified content type.
Definition at line 125 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\exists().
MediaWiki\Request\WebRequestUpload::isIniSizeOverflow | ( | ) |
Returns whether this upload failed because of overflow of a maximum set in php.ini.
Definition at line 155 of file WebRequestUpload.php.
References MediaWiki\Request\WebRequestUpload\getError(), and wfShorthandToInteger().
|
protected |
Definition at line 42 of file WebRequestUpload.php.
Referenced by MediaWiki\Request\WebRequestUpload\exists().
|
protected |
Definition at line 44 of file WebRequestUpload.php.
|
protected |
Definition at line 40 of file WebRequestUpload.php.
Referenced by MediaWiki\Request\FauxRequestUpload\__construct(), and MediaWiki\Request\WebRequestUpload\__construct().
const MediaWiki\Request\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 38 of file WebRequestUpload.php.
Referenced by MediaWiki\Request\FauxRequest\setUpload().