Предопределенные константы
Перечисленные ниже константы определены данным расширением и могут быть доступны только в том случае, если PHP был собран с поддержкой этого расширения или же в том случае, если данное расширение подгружается во время выполнения.
ZipArchive uses class constants. There is three types of constants, Flags (FL_) errors (ER_) or 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
Коментарии
#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 条目已被删除