MediaWiki master
|
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. | |
static | setHeader ( $header) |
static | stream ( $fname, $headers=[], $sendErrors=true, $optHeaders=[], $flags=0) |
Stream a file to the browser, adding all the headings and fun stuff. | |
Functions related to the output of file content.
Definition at line 37 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 prevention checks |
Definition at line 92 of file StreamFile.php.
References MediaWiki\MainConfigNames\CheckFileExtensions, MediaWiki\MainConfigNames\FileExtensions, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\MainConfigNames\MimeTypeExclusions, MediaWiki\MainConfigNames\ProhibitedFileExtensions, MediaWiki\MainConfigNames\StrictFileExtensions, MediaWiki\MainConfigNames\TrivialMimeDetection, and MediaWiki\MainConfigNames\VerifyMimeType.
|
static |
string | $header |
Definition at line 81 of file StreamFile.php.
References $header.
|
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) |
int | $flags | Bitfield of STREAM_* constants |
Definition at line 53 of file StreamFile.php.