Class MOXMAN_Zip_ZipWriter

InheritanceMOXMAN_Zip_ZipWriter

This class can generate zip files fast by using store instead of deflate compression.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructs a new ZipWriter instance. MOXMAN_Zip_ZipWriter
addDirectory() Adds a directory to the zip. MOXMAN_Zip_ZipWriter
addEntry() Adds an entry item. MOXMAN_Zip_ZipWriter
addFile() Adds a file to the zip. MOXMAN_Zip_ZipWriter
addFileData() Adds a file with data to the zip. MOXMAN_Zip_ZipWriter
setCompressionLevel() Sets the compression level 0 equals simple storage and 9 is the maximum compression. MOXMAN_Zip_ZipWriter
toString() Returns the zip as a string that can be stored or streamed. MOXMAN_Zip_ZipWriter

Method Details

__construct() public method

Constructs a new ZipWriter instance.

public void __construct ( $settings = [] )
$settings Array

Optional array with settings for the zip writer.

addDirectory() public method

Adds a directory to the zip.

public void addDirectory ( $zipPath, $path null )
$zipPath string

Path within zip file.

$path string

Optional local file system path to add into zip.

addEntry() public method

Adds an entry item.

public void addEntry ( $zipPath, $entry null )
$zipPath string

Path within zip file.

$entry array

Optional entry array to add.

addFile() public method

Adds a file to the zip.

public void addFile ( $zipPath, $path )
$zipPath string

Path within zip file.

$path string

Path of local file to add.

addFileData() public method

Adds a file with data to the zip.

public void addFileData ( $zipPath, $data )
$zipPath string

Path within zip file.

$data string

Data to set as file contents.

setCompressionLevel() public method

Sets the compression level 0 equals simple storage and 9 is the maximum compression.

public void setCompressionLevel ( $level )
$level int

Compression level to use 0 = store, 9 = max

toString() public method

Returns the zip as a string that can be stored or streamed.

public string toString ( )
return string

Zip file as a string.