预定义常量

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

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

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

User Contributed Notes

There are no user contributed notes for this page.
To Top