Downloader
in package
Assist downloading files when samples are run in browser.
Never run as part of unit tests, which are command line.
Tags
Table of Contents
Constants
- CONTENT_TYPES = ['xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xls' => 'application/vnd.ms-excel', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'csv' => 'text/csv', 'html' => 'text/html', 'pdf' => 'application/pdf']
Properties
Methods
- __construct() : mixed
- download() : void
- headers() : void
- cacheHeaders() : void
- contentDisposition() : void
- contentType() : void
- fileSize() : void
Constants
CONTENT_TYPES
protected
mixed
CONTENT_TYPES
= ['xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xls' => 'application/vnd.ms-excel', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'csv' => 'text/csv', 'html' => 'text/html', 'pdf' => 'application/pdf']
Properties
$filename
protected
string
$filename
$filepath
protected
string
$filepath
$filetype
protected
string
$filetype
$oldIE
protected
bool
$oldIE
$writer
protected
IWriter|null
$writer
Methods
__construct()
public
__construct(string|IWriter $folder, string $filename[, string|null $filetype = null ][, bool $oldIE = false ]) : mixed
Parameters
- $folder : string|IWriter
- $filename : string
- $filetype : string|null = null
- $oldIE : bool = false
download()
public
download() : void
headers()
public
headers() : void
cacheHeaders()
protected
cacheHeaders() : void
contentDisposition()
protected
contentDisposition() : void
contentType()
protected
contentType() : void
fileSize()
protected
fileSize() : void