MediaWiki  1.29.2
WebRequestUpload Class Reference

Object to access the $_FILES array. More...

Public Member Functions

 __construct ( $request, $key)
 Constructor. More...
 
 exists ()
 Return whether a file with this name was uploaded. More...
 
 getError ()
 Return the upload error. More...
 
 getName ()
 Return the original filename of the uploaded file. More...
 
 getSize ()
 Return the file size of the uploaded file. More...
 
 getTempName ()
 Return the path to the temporary file. More...
 
 isIniSizeOverflow ()
 Returns whether this upload failed because of overflow of a maximum set in php.ini. More...
 

Protected Attributes

 $doesExist
 
 $fileInfo
 
 $request
 

Detailed Description

Object to access the $_FILES array.

Definition at line 28 of file WebRequestUpload.php.

Constructor & Destructor Documentation

◆ __construct()

WebRequestUpload::__construct (   $request,
  $key 
)

Constructor.

Should only be called by WebRequest

Parameters
WebRequest$requestThe associated request
string$keyKey in $_FILES array (name of form field)

Definition at line 39 of file WebRequestUpload.php.

References $request, and request.

Member Function Documentation

◆ exists()

WebRequestUpload::exists ( )

Return whether a file with this name was uploaded.

Returns
bool

Definition at line 52 of file WebRequestUpload.php.

References $doesExist.

Referenced by getError(), getName(), getSize(), and getTempName().

◆ getError()

WebRequestUpload::getError ( )

Return the upload error.

See link for explanation https://secure.php.net/manual/en/features.file-upload.errors.php

Returns
int One of the UPLOAD_ constants, 0 if non-existent

Definition at line 109 of file WebRequestUpload.php.

References exists().

Referenced by isIniSizeOverflow().

◆ getName()

WebRequestUpload::getName ( )

Return the original filename of the uploaded file.

Returns
string|null Filename or null if non-existent

Definition at line 61 of file WebRequestUpload.php.

References $name, $wgContLang, exists(), global, and wfDebug().

◆ getSize()

WebRequestUpload::getSize ( )

Return the file size of the uploaded file.

Returns
int File size or zero if non-existent

Definition at line 82 of file WebRequestUpload.php.

References exists().

◆ getTempName()

WebRequestUpload::getTempName ( )

Return the path to the temporary file.

Returns
string|null Path or null if non-existent

Definition at line 95 of file WebRequestUpload.php.

References exists().

◆ isIniSizeOverflow()

WebRequestUpload::isIniSizeOverflow ( )

Returns whether this upload failed because of overflow of a maximum set in php.ini.

Returns
bool

Definition at line 123 of file WebRequestUpload.php.

References getError(), request, and wfShorthandToInteger().

Member Data Documentation

◆ $doesExist

WebRequestUpload::$doesExist
protected

Definition at line 30 of file WebRequestUpload.php.

Referenced by exists().

◆ $fileInfo

WebRequestUpload::$fileInfo
protected

Definition at line 31 of file WebRequestUpload.php.

◆ $request

WebRequestUpload::$request
protected

Definition at line 29 of file WebRequestUpload.php.

Referenced by __construct().


The documentation for this class was generated from the following file: