\JArchiveZip
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 <http://www.horde.org>
Synopsis
class JArchiveZip
implements
JArchiveExtractable
{
- // members
- private $_methods;
- private $_ctrlDirHeader;
- private $_ctrlDirEnd;
- private $_fileHeader;
- private $_data;
- private $_metadata;
- // methods
- public boolean create()
- public boolean extract()
- public static boolean isSupported()
- public static boolean hasNativeSupport()
- public boolean checkZipData()
- protected mixed extractCustom()
- protected boolean extractNative()
- private boolean _readZipInfo()
- private string _getFileData()
- protected int _unix2DOSTime()
- private void _addToZIPFile()
- private boolean _createZIPFile()
Hierarchy
Implements
Tasks
Tasks
Line | Task |
---|---|
102+ | Finish Implementation |
586+ | Review and finish implementation |
697+ | Review and finish implementation |
Members
private
- $_ctrlDirEnd
—
string
End of central directory record. - $_ctrlDirHeader
—
string
Beginning of central directory record. - $_data
—
string
ZIP file data buffer - $_fileHeader
—
string
Beginning of file contents. - $_metadata
—
array
ZIP file metadata array - $_methods
—
array
ZIP compression methods.
Methods
private
- _addToZIPFile() — Adds a "file" to the ZIP archive.
- _createZIPFile() — Creates the ZIP file.
- _getFileData() — Returns the file data for a file by offsest in the ZIP archive
- _readZipInfo() — Get the list of files/data from a ZIP archive buffer.
protected
- _unix2DOSTime() — Converts a UNIX timestamp to a 4-byte DOS date and time format (date in high 2-bytes, time in low 2-bytes allowing magnitude comparison).
- extractCustom() — Extract a ZIP compressed file to a given path using a php based algorithm that only requires zlib support
- extractNative() — Extract a ZIP compressed file to a given path using native php api calls for speed
public
- checkZipData() — Checks to see if the data is a valid ZIP file.
- create() — Create a ZIP compressed file from an array of file data.
- extract() — Extract a ZIP compressed file to a given path
- hasNativeSupport() — Method to determine if the server has native zip support for faster handling
- isSupported() — Tests whether this adapter can unpack files on this computer.