MediaWiki
1.28.0
|
Functions related to the output of file content. More...
Static Public Member Functions | |
static | contentTypeFromPath ($filename, $safe=true) |
Determine the file type of a file based on the path. More... | |
static | parseRange ($range, $size) |
Convert a Range header value to an absolute (start, end) range tuple. More... | |
static | send404Message ($fname, $flags=0) |
Send out a standard 404 message for a file. More... | |
static | stream ($fname, $headers=[], $sendErrors=true, $optHeaders=[], $flags=0) |
Stream a file to the browser, adding all the headings and fun stuff. More... | |
Public Attributes | |
const | STREAM_ALLOW_OB = HTTPFileStreamer::STREAM_ALLOW_OB |
const | STREAM_HEADLESS = HTTPFileStreamer::STREAM_HEADLESS |
Functions related to the output of file content.
Definition at line 26 of file StreamFile.php.
|
static |
Determine the file type of a file based on the path.
string | $filename | Storage path or file system path |
bool | $safe | Whether to do retroactive upload blacklist checks |
Definition at line 93 of file StreamFile.php.
References $ext, $type, $wgCheckFileExtensions, $wgFileBlacklist, $wgFileExtensions, $wgMimeTypeBlacklist, $wgStrictFileExtensions, $wgTrivialMimeDetection, $wgVerifyMimeType, UploadBase\checkFileExtensionList(), global, list, MimeMagic\singleton(), and UploadBase\splitExtensions().
Referenced by FileBackendDBRepoWrapper\streamFile().
|
static |
Convert a Range header value to an absolute (start, end) range tuple.
string | $range | Range header value |
integer | $size | File size |
Definition at line 82 of file StreamFile.php.
References HTTPFileStreamer\parseRange().
|
static |
Send out a standard 404 message for a file.
string | $fname | Full name and path of the file to stream |
integer | $flags | Bitfield of STREAM_* constants |
Definition at line 70 of file StreamFile.php.
References $flags, $fname, and HTTPFileStreamer\send404Message().
Referenced by SwiftFileBackend\doStreamFile().
|
static |
Stream a file to the browser, adding all the headings and fun stuff.
Headers sent include: Content-type, Content-Length, Last-Modified, and Content-Disposition.
string | $fname | Full name and path of the file to stream |
array | $headers | Any additional headers to send if the file exists |
bool | $sendErrors | Send error messages if errors occur (like 404) |
array | $optHeaders | HTTP request header map (e.g. "range") (use lowercase keys) |
integer | $flags | Bitfield of STREAM_* constants |
MWException |
Definition at line 45 of file StreamFile.php.
References $flags, $fname, and FileBackend\isStoragePath().
Referenced by MediaTransformOutput\streamFileWithStatus().
const StreamFile::STREAM_ALLOW_OB = HTTPFileStreamer::STREAM_ALLOW_OB |
Definition at line 30 of file StreamFile.php.
const StreamFile::STREAM_HEADLESS = HTTPFileStreamer::STREAM_HEADLESS |
Definition at line 28 of file StreamFile.php.
Referenced by SwiftFileBackend\doStreamFile().