Constants

DEFAULT_DEFLATE_LEVEL

DEFAULT_DEFLATE_LEVEL = 6

Properties

$comment

$comment : string

Type

string

$largeFileSize

$largeFileSize : int

Size, in bytes, of the largest file to try and load into memory (used by addFileFromPath()). Large files may also be compressed differently; see the 'largeFileMethod' option. Default is ~20 Mb.

Type

int

$largeFileMethod

$largeFileMethod : \ZipStream\Option\Method

How to handle large files. Legal values are Method::STORE() (the default), or Method::DEFLATE(). STORE sends the file raw and is significantly faster, while DEFLATE compresses the file and is much, much slower. Note that DEFLATE must compress the file twice and is extremely slow.

Type

Method

$sendHttpHeaders

$sendHttpHeaders : bool

Boolean indicating whether or not to send the HTTP headers for this file.

Type

bool

$httpHeaderCallback

$httpHeaderCallback : callable

The method called to send headers

Type

callable

$enableZip64

$enableZip64 : bool

Enable Zip64 extension, supporting very large archives (any size > 4 GB or file count > 64k)

Type

bool

$zeroHeader

$zeroHeader : bool

Enable streaming files with single read where general purpose bit 3 indicates local file header contain zero values in crc and size fields, these appear only after file contents in data descriptor block.

Type

bool

$statFiles

$statFiles : bool

Enable reading file stat for determining file size.

When a 32-bit system reads file size that is over 2 GB, invalid value appears in file size due to integer overflow. Should be disabled on 32-bit systems with method addFileFromPath if any file may exceed 2 GB. In this case file will be read in blocks and correct size will be determined from content.

Type

bool

$flushOutput

$flushOutput : bool

Enable flush after every write to output stream.

Type

bool

$contentDisposition

$contentDisposition : string

HTTP Content-Disposition. Defaults to 'attachment', where FILENAME is the specified filename.

Note that this does nothing if you are not sending HTTP headers.

Type

string

$contentType

$contentType : string

Note that this does nothing if you are not sending HTTP headers.

Type

string

$deflateLevel

$deflateLevel : int

Type

int

$outputStream

$outputStream : resource

Type

resource

Methods

__construct()

__construct() : mixed

Options constructor.

Returns

mixed —

getComment()

getComment() : string

Returns

string —

setComment()

setComment(string  $comment) : void

Parameters

string $comment

getLargeFileSize()

getLargeFileSize() : int

Returns

int —

setLargeFileSize()

setLargeFileSize(int  $largeFileSize) : void

Parameters

int $largeFileSize

getLargeFileMethod()

getLargeFileMethod() : \ZipStream\Option\Method

Returns

\ZipStream\Option\Method —

setLargeFileMethod()

setLargeFileMethod(\ZipStream\Option\Method  $largeFileMethod) : void

Parameters

\ZipStream\Option\Method $largeFileMethod

isSendHttpHeaders()

isSendHttpHeaders() : bool

Returns

bool —

setSendHttpHeaders()

setSendHttpHeaders(bool  $sendHttpHeaders) : void

Parameters

bool $sendHttpHeaders

getHttpHeaderCallback()

getHttpHeaderCallback() : callable

Returns

callable —

setHttpHeaderCallback()

setHttpHeaderCallback(callable  $httpHeaderCallback) : void

Parameters

callable $httpHeaderCallback

isEnableZip64()

isEnableZip64() : bool

Returns

bool —

setEnableZip64()

setEnableZip64(bool  $enableZip64) : void

Parameters

bool $enableZip64

isZeroHeader()

isZeroHeader() : bool

Returns

bool —

setZeroHeader()

setZeroHeader(bool  $zeroHeader) : void

Parameters

bool $zeroHeader

isFlushOutput()

isFlushOutput() : bool

Returns

bool —

setFlushOutput()

setFlushOutput(bool  $flushOutput) : void

Parameters

bool $flushOutput

isStatFiles()

isStatFiles() : bool

Returns

bool —

setStatFiles()

setStatFiles(bool  $statFiles) : void

Parameters

bool $statFiles

getContentDisposition()

getContentDisposition() : string

Returns

string —

setContentDisposition()

setContentDisposition(string  $contentDisposition) : void

Parameters

string $contentDisposition

getContentType()

getContentType() : string

Returns

string —

setContentType()

setContentType(string  $contentType) : void

Parameters

string $contentType

getOutputStream()

getOutputStream() : resource

Returns

resource —

setOutputStream()

setOutputStream(resource  $outputStream) : void

Parameters

resource $outputStream

getDeflateLevel()

getDeflateLevel() : int

Returns

int —

setDeflateLevel()

setDeflateLevel(int  $deflateLevel) : void

Parameters

int $deflateLevel