class JArchiveZip implements JArchiveExtractable

ZIP format adapter for the JArchive class

The ZIP compression code is partially based on code from: Eric Mueller eric@themepark.com http://www.zend.com/codex.php?id=535&single=1

Deins125 webmaster@atlant.ru http://www.zend.com/codex.php?id=470&single=1

The ZIP compression date code is partially based on code from Peter Listiak mlady@users.sourceforge.net

This class is inspired from and draws heavily in code and concept from the Compress package of The Horde Project https://www.horde.org

Methods

boolean
create( string $archive, array $files)

Create a ZIP compressed file from an array of file data.

boolean
extract( string $archive, string $destination, array $options = array())

Extract a ZIP compressed file to a given path

static  boolean
isSupported()

Tests whether this adapter can unpack files on this computer.

static  boolean
hasNativeSupport()

Method to determine if the server has native zip support for faster handling

boolean
checkZipData( string $data)

Checks to see if the data is a valid ZIP file.

Details

boolean create( string $archive, array $files)

Create a ZIP compressed file from an array of file data.

Parameters

string $archive Path to save archive.
array $files Array of files to add to archive.

Return Value

boolean True if successful.

boolean extract( string $archive, string $destination, array $options = array())

Extract a ZIP compressed file to a given path

Parameters

string $archive Path to archive to extract
string $destination Path to extract archive to
array $options Extraction options [may be unused]

Return Value

boolean True if successful

Exceptions

RuntimeException

static boolean isSupported()

Tests whether this adapter can unpack files on this computer.

Return Value

boolean True if supported

static boolean hasNativeSupport()

Method to determine if the server has native zip support for faster handling

Return Value

boolean True if php has native ZIP support

boolean checkZipData( string $data)

Checks to see if the data is a valid ZIP file.

Parameters

string $data &$data ZIP archive data buffer.

Return Value

boolean True if valid, false if invalid.