MediaWiki
1.34.0
|
A simple implementation of UploadedFileInterface. More...
Public Member Functions | |
__construct (array $data, $fromUpload=true) | |
getClientFilename () | |
getClientMediaType () | |
getError () | |
getSize () | |
getStream () | |
moveTo ( $targetPath) | |
Private Member Functions | |
checkError () | |
Throw if there was an error. More... | |
Private Attributes | |
array | $data |
File data. More... | |
bool | $fromUpload |
bool | $moved = false |
Whether moveTo() was called. More... | |
UploadedFileStream null | $stream = null |
A simple implementation of UploadedFileInterface.
This exists so ParamValidator needn't depend on any specific PSR-7 implementation for a class implementing UploadedFileInterface. It shouldn't be used directly by other code, other than perhaps when implementing Callbacks::getUploadedFile() when another PSR-7 library is not already in use.
Definition at line 20 of file UploadedFile.php.
Wikimedia\ParamValidator\Util\UploadedFile::__construct | ( | array | $data, |
$fromUpload = true |
|||
) |
array | $data | Data from $_FILES |
bool | $fromUpload | Set false if using this task with data not from $_FILES. Intended for unit testing. |
Definition at line 39 of file UploadedFile.php.
References Wikimedia\ParamValidator\Util\UploadedFile\$data, and Wikimedia\ParamValidator\Util\UploadedFile\$fromUpload.
|
private |
Throw if there was an error.
RuntimeException |
Definition at line 48 of file UploadedFile.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFile\getStream(), and Wikimedia\ParamValidator\Util\UploadedFile\moveTo().
Wikimedia\ParamValidator\Util\UploadedFile::getClientFilename | ( | ) |
Definition at line 132 of file UploadedFile.php.
Wikimedia\ParamValidator\Util\UploadedFile::getClientMediaType | ( | ) |
Definition at line 137 of file UploadedFile.php.
Wikimedia\ParamValidator\Util\UploadedFile::getError | ( | ) |
Definition at line 128 of file UploadedFile.php.
Wikimedia\ParamValidator\Util\UploadedFile::getSize | ( | ) |
Definition at line 124 of file UploadedFile.php.
Wikimedia\ParamValidator\Util\UploadedFile::getStream | ( | ) |
Definition at line 86 of file UploadedFile.php.
References Wikimedia\ParamValidator\Util\UploadedFile\$stream, and Wikimedia\ParamValidator\Util\UploadedFile\checkError().
Wikimedia\ParamValidator\Util\UploadedFile::moveTo | ( | $targetPath | ) |
Definition at line 96 of file UploadedFile.php.
References Wikimedia\ParamValidator\Util\UploadedFile\checkError().
|
private |
File data.
Definition at line 23 of file UploadedFile.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFile\__construct().
|
private |
Definition at line 26 of file UploadedFile.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFile\__construct().
|
private |
Whether moveTo() was called.
Definition at line 32 of file UploadedFile.php.
|
private |
Definition at line 29 of file UploadedFile.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFile\getStream().