Constants

DEFAULT_DEFLATE_LEVEL

DEFAULT_DEFLATE_LEVEL = 6

Properties

$comment

$comment : string

Type

string

$largeFileSize

$largeFileSize : integer

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

integer

$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

\ZipStream\Option\Method

$sendHttpHeaders

$sendHttpHeaders : boolean

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

Type

boolean

$httpHeaderCallback

$httpHeaderCallback : Callable

The method called to send headers

Type

Callable

$enableZip64

$enableZip64 : boolean

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

Type

boolean

$zeroHeader

$zeroHeader : boolean

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

boolean

$statFiles

$statFiles : boolean

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

boolean

$flushOutput

$flushOutput : boolean

Enable flush after every write to output stream.

Type

boolean

$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 : integer

Type

integer

$outputStream

$outputStream : resource

Type

resource

Methods

__construct()

__construct() 

Options constructor.

getComment()

getComment() 

setComment()

setComment(\ZipStream\Option\string  $comment) 

Parameters

\ZipStream\Option\string $comment

getLargeFileSize()

getLargeFileSize() 

setLargeFileSize()

setLargeFileSize(\ZipStream\Option\int  $largeFileSize) 

Parameters

\ZipStream\Option\int $largeFileSize

getLargeFileMethod()

getLargeFileMethod() 

setLargeFileMethod()

setLargeFileMethod(\ZipStream\Option\Method  $largeFileMethod) 

Parameters

\ZipStream\Option\Method $largeFileMethod

isSendHttpHeaders()

isSendHttpHeaders() 

setSendHttpHeaders()

setSendHttpHeaders(\ZipStream\Option\bool  $sendHttpHeaders) 

Parameters

\ZipStream\Option\bool $sendHttpHeaders

getHttpHeaderCallback()

getHttpHeaderCallback() 

setHttpHeaderCallback()

setHttpHeaderCallback(callable  $httpHeaderCallback) 

Parameters

callable $httpHeaderCallback

isEnableZip64()

isEnableZip64() 

setEnableZip64()

setEnableZip64(\ZipStream\Option\bool  $enableZip64) 

Parameters

\ZipStream\Option\bool $enableZip64

isZeroHeader()

isZeroHeader() 

setZeroHeader()

setZeroHeader(\ZipStream\Option\bool  $zeroHeader) 

Parameters

\ZipStream\Option\bool $zeroHeader

isFlushOutput()

isFlushOutput() 

setFlushOutput()

setFlushOutput(\ZipStream\Option\bool  $flushOutput) 

Parameters

\ZipStream\Option\bool $flushOutput

isStatFiles()

isStatFiles() 

setStatFiles()

setStatFiles(\ZipStream\Option\bool  $statFiles) 

Parameters

\ZipStream\Option\bool $statFiles

getContentDisposition()

getContentDisposition() 

setContentDisposition()

setContentDisposition(\ZipStream\Option\string  $contentDisposition) 

Parameters

\ZipStream\Option\string $contentDisposition

getContentType()

getContentType() 

setContentType()

setContentType(\ZipStream\Option\string  $contentType) 

Parameters

\ZipStream\Option\string $contentType

getOutputStream()

getOutputStream() : resource

Returns

resource

setOutputStream()

setOutputStream(resource  $outputStream) 

Parameters

resource $outputStream

getDeflateLevel()

getDeflateLevel() : integer

Returns

integer

setDeflateLevel()

setDeflateLevel(integer  $deflateLevel) 

Parameters

integer $deflateLevel