[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
Functions related to the output of file content. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
File Size: | 202 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
StreamFile:: (3 methods):
stream()
prepareForStream()
contentTypeFromPath()
Class: StreamFile - X-Ref
Functions related to the output of file contentstream( $fname, $headers = array() X-Ref |
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. param: string $fname Full name and path of the file to stream param: array $headers Any additional headers to send param: bool $sendErrors Send error messages if errors occur (like 404) return: bool Success |
prepareForStream($path, $info, $headers = array() X-Ref |
Call this function used in preparation before streaming a file. This function does the following: (a) sends Last-Modified, Content-type, and Content-Disposition headers (b) cancels any PHP output buffering and automatic gzipping of output (c) sends Content-Length header based on HTTP_IF_MODIFIED_SINCE check param: string $path Storage path or file system path param: array|bool $info File stat info with 'mtime' and 'size' fields param: array $headers Additional headers to send param: bool $sendErrors Send error messages if errors occur (like 404) return: int|bool READY_STREAM, NOT_MODIFIED, or false on failure |
contentTypeFromPath( $filename, $safe = true ) X-Ref |
Determine the file type of a file based on the path param: string $filename Storage path or file system path param: bool $safe Whether to do retroactive upload blacklist checks return: null|string |
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |