Class MOXMAN_Zip_ZipWriter
Inheritance | MOXMAN_Zip_ZipWriter |
---|
This class can generate zip files fast by using store instead of deflate compression.
Public Methods
Method | Description | Defined 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
Constructs a new ZipWriter instance.
public void __construct ( $settings = [] ) | ||
$settings | Array | Optional array with settings for the zip writer. |
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. |
Adds an entry item.
public void addEntry ( $zipPath, $entry = null ) | ||
$zipPath | string | Path within zip file. |
$entry | array | Optional entry array to add. |
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. |
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. |
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 |
Returns the zip as a string that can be stored or streamed.
public string toString ( ) | ||
return | string | Zip file as a string. |
---|