略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 预定义常量

2024-11-13

预定义常量

下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。

ZipArchive 使用的类常量。 有以下三类常量:Flags(以 FL_ 为前缀),errors(以 ER_ 为前缀)以及 mode(没有前缀)。

ZIPARCHIVE::CREATE (integer)
如果不存在则创建一个zip压缩包。
ZIPARCHIVE::OVERWRITE (integer)
总是以一个新的压缩包开始,此模式下如果已经存在则会被覆盖。
ZIPARCHIVE::EXCL (integer)
如果压缩包已经存在,则出错。
ZipArchive::RDONLY (integer)
只读模式打开压缩包。 Available as of PHP 7.4.3 and PECL zip 1.17.1, respectively, if built against libzip ≥ 1.0.0.
ZIPARCHIVE::CHECKCONS (integer)
对压缩包执行额外的一致性检查,如果失败则显示错误。
ZIPARCHIVE::FL_NOCASE (integer)
查找时忽略名称的大小写。
ZIPARCHIVE::FL_NODIR (integer)
忽略目录部分
ZIPARCHIVE::FL_COMPRESSED (integer)
读取压缩数据
ZIPARCHIVE::FL_UNCHANGED (integer)
使用原始数据,忽略更改。
ZipArchive::FL_RECOMPRESS (integer)
强制重新压缩数据。 PHP 8.0.0 和 PECL zip 1.18.0 起可以使用。
ZipArchive::FL_ENCRYPTED (integer)
Read encrypted data (implies FL_COMPRESSED). Available as of PHP 8.0.0 and PECL zip 1.18.0.
ZipArchive::FL_OVERWRITE (integer)
If file with name exists, overwrite (replace) it. Available as of PHP 8.0.0 and PECL zip 1.18.0.
ZipArchive::FL_LOCAL (integer)
In local header. Available as of PHP 8.0.0 and PECL zip 1.18.0.
ZipArchive::ZIP_FL_CENTRAL (integer)
In central directory. Available as of PHP 8.0.0 and PECL zip 1.18.0.
ZipArchive::FL_ENC_GUESS (integer)
Guess string encoding (is default). Available as of PHP 7.0.8.
ZipArchive::FL_ENC_RAW (integer)
Get unmodified string. Available as of PHP 7.0.8.
ZipArchive::FL_ENC_STRICT (integer)
Follow specification strictly. Available as of PHP 7.0.8.
ZipArchive::FL_ENC_UTF_8 (integer)
String is UTF-8 encoded. Available as of PHP 7.0.8.
ZipArchive::FL_ENC_CP437 (integer)
String is CP437 encoded. Available as of PHP 7.0.8.
ZIPARCHIVE::CM_DEFAULT (integer)
更好的压缩或存储。
ZIPARCHIVE::CM_STORE (integer)
存储(不压缩)。
ZIPARCHIVE::CM_SHRINK (integer)
收缩
ZIPARCHIVE::CM_REDUCE_1 (integer)
用因子1换算
ZIPARCHIVE::CM_REDUCE_2 (integer)
用因子2换算
ZIPARCHIVE::CM_REDUCE_3 (integer)
用因子3换算
ZIPARCHIVE::CM_REDUCE_4 (integer)
用因子4换算
ZIPARCHIVE::CM_IMPLODE (integer)
聚爆
ZIPARCHIVE::CM_DEFLATE (integer)
deflated
ZIPARCHIVE::CM_DEFLATE64 (integer)
deflate64
ZIPARCHIVE::CM_PKWARE_IMPLODE (integer)
PKWARE imploding
ZIPARCHIVE::CM_BZIP2 (integer)
BZIP2算法
ZipArchive::CM_LZMA (integer)
LZMA 算法
ZipArchive::CM_LZMA2 (integer)
LZMA2 algorithm. Available as of PHP 7.4.3 and PECL zip 1.16.0, respectively, if built against libzip ≥ 1.6.0.
ZipArchive::CM_XZ (integer)
XZ algorithm. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively, if built against libzip ≥ 1.6.0.
ZIPARCHIVE::ER_OK (integer)
没有错误。
ZIPARCHIVE::ER_MULTIDISK (integer)
不支持多磁盘zip压缩包。
ZIPARCHIVE::ER_RENAME (integer)
重命名临时文件失败。
ZIPARCHIVE::ER_CLOSE (integer)
关闭zip压缩包失败。
ZIPARCHIVE::ER_SEEK (integer)
寻址错误
ZIPARCHIVE::ER_READ (integer)
读取错误
ZIPARCHIVE::ER_WRITE (integer)
写入错误
ZIPARCHIVE::ER_CRC (integer)
CRC校验失败
ZIPARCHIVE::ER_ZIPCLOSED (integer)
zip压缩包已关闭
ZIPARCHIVE::ER_NOENT (integer)
没有文件
ZIPARCHIVE::ER_EXISTS (integer)
文件已经存在
ZIPARCHIVE::ER_OPEN (integer)
不能打开文件
ZIPARCHIVE::ER_TMPOPEN (integer)
创建临时文件失败
ZIPARCHIVE::ER_ZLIB (integer)
Zlib错误
ZIPARCHIVE::ER_MEMORY (integer)
内存分配失败
ZIPARCHIVE::ER_CHANGED (string)
条目已被改变
ZIPARCHIVE::ER_COMPNOTSUPP (integer)
不支持的压缩方式
ZIPARCHIVE::ER_EOF (integer)
过早的EOF
ZIPARCHIVE::ER_INVAL (integer)
无效的参数
ZIPARCHIVE::ER_NOZIP (integer)
不是一个zip压缩包
ZIPARCHIVE::ER_INTERNAL (integer)
内部错误(Internal error)
ZIPARCHIVE::ER_INCONS (integer)
Zip压缩包不一致
ZIPARCHIVE::ER_REMOVE (integer)
不能移除文件
ZIPARCHIVE::ER_DELETED (integer)
条目已被删除
ZipArchive::ER_ENCRNOTSUPP (integer)
不支持的压缩方式。 PHP 7.4.3 和 PECL zip 1.16.1 起可用。
ZipArchive::ER_RDONLY (integer)
Read-only archive. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively.
ZipArchive::ER_NOPASSWD (integer)
No password provided. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively.
ZipArchive::ER_WRONGPASSWD (integer)
Wrong password provided. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively.
ZipArchive::ZIP_ER_OPNOTSUPP (integer)
Operation not supported. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively, if built against libzip ≥ 1.0.0.
ZipArchive::ZIP_ER_INUSE (integer)
Resource still in use. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively, if built against libzip ≥ 1.0.0.
ZipArchive::ZIP_ER_TELL (integer)
Tell error. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively, if built against libzip ≥ 1.0.0.
ZipArchive::ZIP_ER_COMPRESSED_DATA (integer)
Compressed data invalid. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively, if built against libzip ≥ 1.6.0.
ZipArchive::ER_CANCELLED (integer)
Operation cancelled. Available as of PHP 7.4.3 and PECL zip 1.16.1, respectively, if built against libzip ≥ 1.6.0.
ZipArchive::EM_NONE (integer)
No encryption, since PHP 7.2.0, PECL zip 1.14.0
ZipArchive::EM_AES_128 (integer)
AES 128 encryption, since PHP 7.2.0, PECL zip 1.14.0
ZipArchive::EM_AES_192 (integer)
AES 1192 encryption, since PHP 7.2.0, PECL zip 1.14.0
ZipArchive::EM_AES_256 (integer)
AES 256 encryption, since PHP 7.2.0, PECL zip 1.14.0
ZipArchive::LIBZIP_VERSION (string)
Zip library version. Available as of PHP 7.4.3 and PECL zip 1.16.0.
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
add a noteadd a note

User Contributed Notes 2 notes

up
49
scott at bluecamel dot eml dot cc
14 years ago
#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 */
up
4
ohcc at 163 dot com
6 years ago
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    条目已被删除

官方地址:https://www.php.net/manual/en/zip.constants.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3