Compression adapter for Gzip (ZLib)

package Default
inherited_from \Zend\Filter\Compress\AbstractCompressionAlgorithm

 Methods

Class constructor

__construct(null|array|\Traversable $options = null
inherited_from \Zend\Filter\Compress\AbstractCompressionAlgorithm::__construct()

Parameters

$options

nullarray\Traversable

(Optional) Options to set

Exceptions

\Zend\Filter\Exception\ExtensionNotLoadedException if zlib extension not loaded

Class constructor

__construct(null|array|\Traversable $options = null
Inherited

Parameters

$options

nullarray\Traversable

(Optional) Options to set

Compresses the given content

compress(string $content) : string

Parameters

$content

string

Exceptions

\Zend\Filter\Exception\RuntimeException if unable to open archive or error during decompression

Returns

string

Decompresses the given content

decompress(string $content) : string

Parameters

$content

string

Exceptions

\Zend\Filter\Exception\RuntimeException if unable to open archive or error during decompression

Returns

string

Returns the set archive

getArchive() : string

Returns

string

Returns the set compression level

getLevel() : integer

Returns

integer

Returns the set compression mode

getMode() : string

Returns

string

Returns one or all set options

getOptions(string $option = null) : mixed
Inherited

Parameters

$option

string

(Optional) Option to return

Returns

mixed

Sets the archive to use for de-/compression

setArchive(string $archive) : \Zend\Filter\Compress\Gz
fluent This method is part of a fluent interface and will return the same instance

Parameters

$archive

string

Archive to use

Returns

\Zend\Filter\Compress\Gz

Sets a new compression level

setLevel(integer $level) : \Zend\Filter\Compress\Gz
fluent This method is part of a fluent interface and will return the same instance

Parameters

$level

integer

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Compress\Gz

Sets a new compression mode

setMode(string $mode) : \Zend\Filter\Compress\Gz
fluent This method is part of a fluent interface and will return the same instance

Parameters

$mode

string

Supported are 'compress', 'deflate' and 'file'

Exceptions

\Zend\Filter\Exception\InvalidArgumentException for invalid $mode value

Returns

\Zend\Filter\Compress\Gz

Sets all or one option

setOptions(array $options) : \Zend\Filter\Compress\Gz
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

array

Returns

\Zend\Filter\Compress\Gz

Returns the adapter name

toString() : string

Returns

string

 Properties

 

Compression Options array( 'level' => Compression level 0-9 'mode' => Compression mode, can be 'compress', 'deflate' 'archive' => Archive to use )

$options : array

Default

array('level' => 9, 'mode' => 'compress', 'archive' => null)
inherited_from \Zend\Filter\Compress\AbstractCompressionAlgorithm::options
 

$options

$options : array

Default

array()