Functions related to the output of file content.
More...
Functions related to the output of file content.
- Since
- 1.28
Definition at line 28 of file HTTPFileStreamer.php.
HTTPFileStreamer::__construct |
( |
|
$path, |
|
|
array |
$params = [] |
|
) |
| |
- Parameters
-
string | $path | Local filesystem path to a file |
array | $params | Options map, which includes:
- obResetFunc : alternative callback to clear the output buffer
- streamMimeFunc : alternative method to determine the content type from the path
|
Definition at line 47 of file HTTPFileStreamer.php.
References $params, and $path.
static HTTPFileStreamer::contentTypeFromPath |
( |
|
$filename | ) |
|
|
staticprotected |
Determine the file type of a file based on the path.
- Parameters
-
string | $filename | Storage path or file system path |
- Returns
- null|string
Definition at line 251 of file HTTPFileStreamer.php.
References $ext.
static HTTPFileStreamer::parseRange |
( |
|
$range, |
|
|
|
$size |
|
) |
| |
|
static |
Convert a Range header value to an absolute (start, end) range tuple.
- Parameters
-
string | $range | Range header value |
integer | $size | File size |
- Returns
- array|string Returns error string on failure (start, end, length)
- Since
- 1.24
Definition at line 208 of file HTTPFileStreamer.php.
References list.
Referenced by StreamFile\parseRange().
static HTTPFileStreamer::resetOutputBuffers |
( |
| ) |
|
|
staticprotected |
static HTTPFileStreamer::send404Message |
( |
|
$fname, |
|
|
|
$flags = 0 |
|
) |
| |
|
static |
HTTPFileStreamer::stream |
( |
|
$headers = [] , |
|
|
|
$sendErrors = true , |
|
|
|
$optHeaders = [] , |
|
|
|
$flags = 0 |
|
) |
| |
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.
- Parameters
-
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 |
- Exceptions
-
- Returns
- bool Success
Definition at line 69 of file HTTPFileStreamer.php.
References $flags, $header, $type, as, false, HttpStatus\header(), print, TS_RFC2822, and TS_UNIX.
callable HTTPFileStreamer::$obResetFunc |
|
protected |
string HTTPFileStreamer::$path |
|
protected |
callable HTTPFileStreamer::$streamMimeFunc |
|
protected |
const HTTPFileStreamer::STREAM_ALLOW_OB = 2 |
const HTTPFileStreamer::STREAM_HEADLESS = 1 |
The documentation for this class was generated from the following file: