MediaWiki
1.34.0
|
Implementation of StreamInterface for a file in $_FILES. More...
Public Member Functions | |
__construct ( $filename) | |
__destruct () | |
__toString () | |
close () | |
detach () | |
eof () | |
getContents () | |
getMetadata ( $key=null) | |
getSize () | |
isReadable () | |
isSeekable () | |
isWritable () | |
read ( $length) | |
rewind () | |
seek ( $offset, $whence=SEEK_SET) | |
tell () | |
write ( $string) | |
Private Member Functions | |
checkOpen () | |
Check if the stream is open. More... | |
Static Private Member Functions | |
static | quietCall (callable $func, array $args, $fail, $msg) |
Call, throwing on error. More... | |
Private Attributes | |
resource | $fp |
File handle. More... | |
int false null | $size = false |
File size. More... | |
Implementation of StreamInterface for a file in $_FILES.
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.
Definition at line 21 of file UploadedFileStream.php.
Wikimedia\ParamValidator\Util\UploadedFileStream::__construct | ( | $filename | ) |
string | $filename |
Definition at line 54 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\quietCall().
Wikimedia\ParamValidator\Util\UploadedFileStream::__destruct | ( | ) |
Definition at line 68 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\close().
Wikimedia\ParamValidator\Util\UploadedFileStream::__toString | ( | ) |
Definition at line 72 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\getContents(), and Wikimedia\ParamValidator\Util\UploadedFileStream\seek().
|
private |
Check if the stream is open.
RuntimeException | if closed |
Definition at line 62 of file UploadedFileStream.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\getContents(), Wikimedia\ParamValidator\Util\UploadedFileStream\getMetadata(), Wikimedia\ParamValidator\Util\UploadedFileStream\read(), Wikimedia\ParamValidator\Util\UploadedFileStream\seek(), Wikimedia\ParamValidator\Util\UploadedFileStream\tell(), and Wikimedia\ParamValidator\Util\UploadedFileStream\write().
Wikimedia\ParamValidator\Util\UploadedFileStream::close | ( | ) |
Definition at line 85 of file UploadedFileStream.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\__destruct().
Wikimedia\ParamValidator\Util\UploadedFileStream::detach | ( | ) |
Definition at line 93 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\$fp.
Wikimedia\ParamValidator\Util\UploadedFileStream::eof | ( | ) |
Definition at line 118 of file UploadedFileStream.php.
Wikimedia\ParamValidator\Util\UploadedFileStream::getContents | ( | ) |
Definition at line 154 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\checkOpen(), and Wikimedia\ParamValidator\Util\UploadedFileStream\quietCall().
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\__toString().
Wikimedia\ParamValidator\Util\UploadedFileStream::getMetadata | ( | $key = null | ) |
Definition at line 159 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\checkOpen(), and Wikimedia\ParamValidator\Util\UploadedFileStream\quietCall().
Wikimedia\ParamValidator\Util\UploadedFileStream::getSize | ( | ) |
Definition at line 99 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\$size.
Wikimedia\ParamValidator\Util\UploadedFileStream::isReadable | ( | ) |
Definition at line 145 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\$fp.
Wikimedia\ParamValidator\Util\UploadedFileStream::isSeekable | ( | ) |
Definition at line 123 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\$fp.
Wikimedia\ParamValidator\Util\UploadedFileStream::isWritable | ( | ) |
Definition at line 136 of file UploadedFileStream.php.
|
staticprivate |
Call, throwing on error.
callable | $func | Callable to call |
array | $args | Arguments |
mixed | $fail | Failure return value |
string | $msg | Message prefix |
RuntimeException | if $func returns $fail |
Definition at line 38 of file UploadedFileStream.php.
References $args.
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\__construct(), Wikimedia\ParamValidator\Util\UploadedFileStream\getContents(), Wikimedia\ParamValidator\Util\UploadedFileStream\getMetadata(), Wikimedia\ParamValidator\Util\UploadedFileStream\read(), Wikimedia\ParamValidator\Util\UploadedFileStream\seek(), and Wikimedia\ParamValidator\Util\UploadedFileStream\tell().
Wikimedia\ParamValidator\Util\UploadedFileStream::read | ( | $length | ) |
Definition at line 149 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\checkOpen(), and Wikimedia\ParamValidator\Util\UploadedFileStream\quietCall().
Wikimedia\ParamValidator\Util\UploadedFileStream::rewind | ( | ) |
Definition at line 132 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\seek().
Wikimedia\ParamValidator\Util\UploadedFileStream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Definition at line 127 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\checkOpen(), and Wikimedia\ParamValidator\Util\UploadedFileStream\quietCall().
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\__toString(), and Wikimedia\ParamValidator\Util\UploadedFileStream\rewind().
Wikimedia\ParamValidator\Util\UploadedFileStream::tell | ( | ) |
Definition at line 113 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\checkOpen(), and Wikimedia\ParamValidator\Util\UploadedFileStream\quietCall().
Wikimedia\ParamValidator\Util\UploadedFileStream::write | ( | $string | ) |
Definition at line 140 of file UploadedFileStream.php.
References Wikimedia\ParamValidator\Util\UploadedFileStream\checkOpen().
|
private |
File handle.
Definition at line 24 of file UploadedFileStream.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\detach(), Wikimedia\ParamValidator\Util\UploadedFileStream\isReadable(), and Wikimedia\ParamValidator\Util\UploadedFileStream\isSeekable().
|
private |
File size.
False if not set yet.
Definition at line 27 of file UploadedFileStream.php.
Referenced by Wikimedia\ParamValidator\Util\UploadedFileStream\getSize().