Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

ZipArchive uses class constants. There are three types of constants : Flags (prefixed with FL_), errors (prefixed with ER_) and mode (no prefix).

ZipArchive::CREATE (integer)
Create the archive if it does not exist.
ZipArchive::OVERWRITE (integer)
Always start a new archive, this mode will overwrite the file if it already exists.
ZipArchive::EXCL (integer)
Error if archive already exists.
ZipArchive::CHECKCONS (integer)
Perform additional consistency checks on the archive, and error if they fail.
ZipArchive::FL_NOCASE (integer)
Ignore case on name lookup
ZipArchive::FL_NODIR (integer)
Ignore directory component
ZipArchive::FL_COMPRESSED (integer)
Read compressed data
ZipArchive::FL_UNCHANGED (integer)
Use original data, ignoring changes.
ZipArchive::CM_DEFAULT (integer)
better of deflate or store.
ZipArchive::CM_STORE (integer)
stored (uncompressed).
ZipArchive::CM_SHRINK (integer)
shrunk
ZipArchive::CM_REDUCE_1 (integer)
reduced with factor 1
ZipArchive::CM_REDUCE_2 (integer)
reduced with factor 2
ZipArchive::CM_REDUCE_3 (integer)
reduced with factor 3
ZipArchive::CM_REDUCE_4 (integer)
reduced with factor 4
ZipArchive::CM_IMPLODE (integer)
imploded
ZipArchive::CM_DEFLATE (integer)
deflated
ZipArchive::CM_DEFLATE64 (integer)
deflate64
ZipArchive::CM_PKWARE_IMPLODE (integer)
PKWARE imploding
ZipArchive::CM_BZIP2 (integer)
BZIP2 algorithm
ZipArchive::ER_OK (integer)
No error.
ZipArchive::ER_MULTIDISK (integer)
Multi-disk zip archives not supported.
ZipArchive::ER_RENAME (integer)
Renaming temporary file failed.
ZipArchive::ER_CLOSE (integer)
Closing zip archive failed
ZipArchive::ER_SEEK (integer)
Seek error
ZipArchive::ER_READ (integer)
Read error
ZipArchive::ER_WRITE (integer)
Write error
ZipArchive::ER_CRC (integer)
CRC error
ZipArchive::ER_ZIPCLOSED (integer)
Containing zip archive was closed
ZipArchive::ER_NOENT (integer)
No such file.
ZipArchive::ER_EXISTS (integer)
File already exists
ZipArchive::ER_OPEN (integer)
Can't open file
ZipArchive::ER_TMPOPEN (integer)
Failure to create temporary file.
ZipArchive::ER_ZLIB (integer)
Zlib error
ZipArchive::ER_MEMORY (integer)
Memory allocation failure
ZipArchive::ER_CHANGED (string)
Entry has been changed
ZipArchive::ER_COMPNOTSUPP (integer)
Compression method not supported.
ZipArchive::ER_EOF (integer)
Premature EOF
ZipArchive::ER_INVAL (integer)
Invalid argument
ZipArchive::ER_NOZIP (integer)
Not a zip archive
ZipArchive::ER_INTERNAL (integer)
Internal error
ZipArchive::ER_INCONS (integer)
Zip archive inconsistent
ZipArchive::ER_REMOVE (integer)
Can't remove file
ZipArchive::ER_DELETED (integer)
Entry has been deleted