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
-
Operating system constants for external attributes
-
ZipArchive::OPSYS_DOS
(integer) -
ZipArchive::OPSYS_AMIGA
(integer) -
ZipArchive::OPSYS_OPENVMS
(integer) -
ZipArchive::OPSYS_UNIX
(integer) -
ZipArchive::OPSYS_VM_CMS
(integer) -
ZipArchive::OPSYS_ATARI_ST
(integer) -
ZipArchive::OPSYS_OS_2
(integer) -
ZipArchive::OPSYS_MACINTOSH
(integer) -
ZipArchive::OPSYS_Z_SYSTEM
(integer) -
ZipArchive::OPSYS_CPM
(integer) -
ZipArchive::OPSYS_WINDOWS_NTFS
(integer) -
ZipArchive::OPSYS_MVS
(integer) -
ZipArchive::OPSYS_VSE
(integer) -
ZipArchive::OPSYS_ACORN_RISC
(integer) -
ZipArchive::OPSYS_VFAT
(integer) -
ZipArchive::OPSYS_ALTERNATE_MVS
(integer) -
ZipArchive::OPSYS_BEOS
(integer) -
ZipArchive::OPSYS_TANDEM
(integer) -
ZipArchive::OPSYS_OS_400
(integer) -
ZipArchive::OPSYS_OS_X
(integer) -
ZipArchive::OPSYS_DEFAULT
(integer) - Since PHP 5.6.0, PECL zip 1.12.4
Коментарии
#define ZIP_ER_OK 0 /* N No error */
#define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */
#define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */
#define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */
#define ZIP_ER_SEEK 4 /* S Seek error */
#define ZIP_ER_READ 5 /* S Read error */
#define ZIP_ER_WRITE 6 /* S Write error */
#define ZIP_ER_CRC 7 /* N CRC error */
#define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */
#define ZIP_ER_NOENT 9 /* N No such file */
#define ZIP_ER_EXISTS 10 /* N File already exists */
#define ZIP_ER_OPEN 11 /* S Can't open file */
#define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */
#define ZIP_ER_ZLIB 13 /* Z Zlib error */
#define ZIP_ER_MEMORY 14 /* N Malloc failure */
#define ZIP_ER_CHANGED 15 /* N Entry has been changed */
#define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */
#define ZIP_ER_EOF 17 /* N Premature EOF */
#define ZIP_ER_INVAL 18 /* N Invalid argument */
#define ZIP_ER_NOZIP 19 /* N Not a zip archive */
#define ZIP_ER_INTERNAL 20 /* N Internal error */
#define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */
#define ZIP_ER_REMOVE 22 /* S Can't remove file */
#define ZIP_ER_DELETED 23 /* N Entry has been deleted */
0 ZIPARCHIVE::ER_OK 没有错误。
1 ZIPARCHIVE::ER_MULTIDISK 不支持多磁盘zip压缩包。
2 ZIPARCHIVE::ER_RENAME 重命名临时文件失败。
3 ZIPARCHIVE::ER_CLOSE 关闭zip压缩包失败。
4 ZIPARCHIVE::ER_SEEK 寻址错误
5 ZIPARCHIVE::ER_READ 读取错误
6 ZIPARCHIVE::ER_WRITE 写入错误
7 ZIPARCHIVE::ER_CRC CRC校验失败
8 ZIPARCHIVE::ER_ZIPCLOSED zip压缩包已关闭
9 ZIPARCHIVE::ER_NOENT 没有文件
10 ZIPARCHIVE::ER_EXISTS 文件已经存在
11 ZIPARCHIVE::ER_OPEN 不能打开文件
12 ZIPARCHIVE::ER_TMPOPEN 创建临时文件失败
13 ZIPARCHIVE::ER_ZLIB Zlib错误
14 ZIPARCHIVE::ER_MEMORY 内存分配失败
15 ZIPARCHIVE::ER_CHANGED 条目已被改变
16 ZIPARCHIVE::ER_COMPNOTSUPP 不支持的压缩方式
17 ZIPARCHIVE::ER_EOF 过早的EOF
18 ZIPARCHIVE::ER_INVAL 无效的参数
19 ZIPARCHIVE::ER_NOZIP 不是一个zip压缩包
20 ZIPARCHIVE::ER_INTERNAL Internal
21 ZIPARCHIVE::ER_INCONS Zip压缩包不一致
22 ZIPARCHIVE::ER_REMOVE 不能移除文件
23 ZIPARCHIVE::ER_DELETED 条目已被删除