Constantes predefinidas

Estas constantes están definidas por esta extensión y estarán disponibles sólo cuando la extensión haya sido compilada con PHP, o bien sea cargada dinámicamente en ejecución.

ZipArchive usa constantes de clase. Existen tres tipos de constantes: Flags (prefijadas con FL_), errores (prefijados con ER_) y modos (sin prefijo).

Archive open modes
ZipArchive::CREATE (int)
Crea el archivo si no existe.
ZipArchive::OVERWRITE (int)
Si existe un archivo, ignora su contenido actual. En otras palabras, lo trata de la misma manera que un archivo vacío.
ZipArchive::EXCL (int)
Error si el fichero ya existe.
ZipArchive::RDONLY (int)
Abrir archivo en modo de solo lectura. Disponible a partir de PHP 7.4.3 y PECL zip 1.17.1, respectivamente, si se compila con libzip ≥ 1.0.0.
ZipArchive::CHECKCONS (int)
Realiza comprobaciones de coherencia adicionales al archivo, producirá un error si falla.
Archive global flags
ZipArchive::AFL_RDONLY (int)
Archivo en modo de solo lectura, no se puede borrar. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.0, respectivamente, si se compila con libzip ≥ 1.10.0.
ZipArchive::AFL_IS_TORRENTZIP (int)
Sl archivo actual está comprimido en torrentzip. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.0, respectivamente, si se compila con libzip ≥ 1.10.0.
ZipArchive::AFL_WANT_TORRENTZIP (int)
Crear archivo en formato torrentzip. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.0, respectivamente, si se compila con libzip ≥ 1.10.0.
ZipArchive::AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE (int)
No eliminar archivo si el archivo está vacío. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.0, respectivamente, si se compila con libzip ≥ 1.10.0.
Archive flags
ZipArchive::FL_NOCASE (int)
Ignorar mayúsculas el lookup del nombre
ZipArchive::FL_NODIR (int)
Ignorar el componente directorio
ZipArchive::FL_COMPRESSED (int)
Leer datos comprimidos
ZipArchive::FL_UNCHANGED (int)
Usar los datos originales, ignorando cambios.
ZipArchive::FL_RECOMPRESS (int)
Forzar la recompresión de los datos. Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0. Deprecated as of PHP 8.3.0 and PECL zip 1.22.1, will be removed in a future version of libzip.
ZipArchive::FL_ENCRYPTED (int)
Leer datos encriptados (implica FL_COMPRESSED). Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_OVERWRITE (int)
Si existe un archivo con nombre, sobrescríbalo (reemplácelo). Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_LOCAL (int)
En la cabecera local. Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_CENTRAL (int)
En el directorio central. Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_ENC_GUESS (int)
Codificación de la cadena de suposición (guess string) (predeterminado). Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_RAW (int)
Obtener la cadena sin modificaciones. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_STRICT (int)
Seguir la especificación estrictamente. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_UTF_8 (int)
La cadena está codificada en UTF-8. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_CP437 (int)
La cadena está codifica en CP437. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_OPEN_FILE_NOW (int)
Open the file when added instead of waiting for archive to be closed. Be aware of file descriptors consumption. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.1.
Compression modes
ZipArchive::CM_DEFAULT (int)
Mejor para desinflar o almacenar.
ZipArchive::CM_STORE (int)
almacenar (no comprimir).
ZipArchive::CM_SHRINK (int)
Reducir
ZipArchive::CM_REDUCE_1 (int)
reducido con factor 1
ZipArchive::CM_REDUCE_2 (int)
reducido con factor 2
ZipArchive::CM_REDUCE_3 (int)
reducido con factor 3
ZipArchive::CM_REDUCE_4 (int)
reducido con factor 4
ZipArchive::CM_IMPLODE (int)
implodado
ZipArchive::CM_DEFLATE (int)
Deflactado
ZipArchive::CM_DEFLATE64 (int)
deflate64
ZipArchive::CM_PKWARE_IMPLODE (int)
PKWARE imploding
ZipArchive::CM_BZIP2 (int)
Algoritmo BZIP2
ZipArchive::CM_LZMA (int)
Algoritmo LZMA
ZipArchive::CM_LZMA2 (int)
Algoritmo LZMA2. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.0, respectivamente, si se compila con libzip ≥ 1.6.0.
ZipArchive::CM_ZSTD (int)
Algoritmo Zstandard. Disponible a partir de PHP 8.0.0 y PECL zip 1.19.1, respectivamente, si se compila con libzip ≥ 1.8.0.
ZipArchive::CM_XZ (int)
Algoritmo XZ. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.6.0.
ZipArchive::CM_TERSE (int)
ZipArchive::CM_LZ77 (int)
ZipArchive::CM_WAVPACK (int)
ZipArchive::CM_PPMD (int)
Errors
ZipArchive::ER_OK (int)
Sin errores.
ZipArchive::ER_MULTIDISK (int)
Archivos zip multi-disk no soportados.
ZipArchive::ER_RENAME (int)
Mantener fichero temporal fallado.
ZipArchive::ER_CLOSE (int)
Cerrar fichero zip fallado.
ZipArchive::ER_SEEK (int)
Buscar error
ZipArchive::ER_READ (int)
Leer error
ZipArchive::ER_WRITE (int)
Escribir error
ZipArchive::ER_CRC (int)
Error CRC
ZipArchive::ER_ZIPCLOSED (int)
Conteniendo el fichero zip que ha sido cerrado
ZipArchive::ER_NOENT (int)
No existe el fichero.
ZipArchive::ER_EXISTS (int)
El fichero ya existe
ZipArchive::ER_OPEN (int)
No se puede abrir el fichero
ZipArchive::ER_TMPOPEN (int)
Fallo al intentar crear fichero temporal.
ZipArchive::ER_ZLIB (int)
Error de Zlib
ZipArchive::ER_MEMORY (int)
Error de asignación de memoria
ZipArchive::ER_CHANGED (int)
La entrada a cambiado
ZipArchive::ER_COMPNOTSUPP (int)
Método de compresión no soportado.
ZipArchive::ER_EOF (int)
EOF precoz.
ZipArchive::ER_INVAL (int)
Argumento inválido
ZipArchive::ER_NOZIP (int)
No es un archivo zip
ZipArchive::ER_INTERNAL (int)
Error interno
ZipArchive::ER_INCONS (int)
Fichero Zip inconsistente
ZipArchive::ER_REMOVE (int)
No se puede eliminar el fichero
ZipArchive::ER_DELETED (int)
La entrada ha sido eliminada
ZipArchive::ER_ENCRNOTSUPP (int)
No se admite el método de cifrado. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente.
ZipArchive::ER_RDONLY (int)
Archivo de sólo lectura. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente.
ZipArchive::ER_NOPASSWD (int)
No se ha proporcionado ninguna contraseña. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente.
ZipArchive::ER_WRONGPASSWD (int)
Contraseña incorrecta proporcionada. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente.
ZipArchive::ER_OPNOTSUPP (int)
Operación no soportada. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.0.0.
ZipArchive::ER_INUSE (int)
Recurso todavía en uso. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.0.0.
ZipArchive::ER_TELL (int)
Diga error. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.0.0.
ZipArchive::ER_COMPRESSED_DATA (int)
Los datos comprimidos no son válidos. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.6.0.
ZipArchive::ER_CANCELLED (int)
Operation cancelled. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.6.0.
ZipArchive::ER_DATA_LENGTH (int)
Unexpected length of data. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.0, respectivamente, si se compila con libzip ≥ 1.10.0.
ZipArchive::ER_NOT_ALLOWED (int)
Not allowed in torrentzip. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.0, respectivamente, si se compila con libzip ≥ 1.10.0.
Encryption modes
ZipArchive::EM_NONE (int)
No hay encriptación. Disponible a partir de PHP 7.2.0 y PECL zip 1.14.0, respectivamente.
ZipArchive::EM_TRAD_PKWARE (int)
Traditional PKWARE encryption. Disponible a partir de PHP 8.0.0 y PECL zip 1.19.0, respectivamente.
ZipArchive::EM_AES_128 (int)
Encriptación AES 128. Disponible a partir de PHP 7.2.0 y PECL zip 1.14.0, respectivamente, si se compila con libzip ≥ 1.2.0.
ZipArchive::EM_AES_192 (int)
Encriptación AES 192. Disponible a partir de PHP 7.2.0 y PECL zip 1.14.0, respectivamente, si se compila con libzip ≥ 1.2.0.
ZipArchive::EM_AES_256 (int)
Encriptación AES 256. Disponible a partir de PHP 7.2.0 y PECL zip 1.14.0, respectivamente, si se compila con libzip ≥ 1.2.0.
ZipArchive::EM_UNKNOWN (int)
Unknown encryption algorithm. Disponible a partir de PHP 8.0.0 y PECL zip 1.19.0, respectivamente.
Length parameter constants
ZipArchive::LENGTH_TO_END (int)
Use file size, if the file grows additional data is ignored, if the file shrinks an error is raised (ZipArchive::ER_DATA_LENGTH). Disponible a partir de PHP 8.3.0 y PECL zip 1.22.2.
ZipArchive::LENGTH_UNCHECKED (int)
Use all available data. Disponible a partir de PHP 8.3.0 y PECL zip 1.22.2, si se compila con libzip ≥ 1.10.1.
Other constants
ZipArchive::LIBZIP_VERSION (string)
Versión de la biblioteca Zip. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.0.
Constantes de sistema operativo para atributos externos
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)
Disponible a partir de PECL zip 1.12.4.
add a note add a note

User Contributed Notes 2 notes

up
49
scott at bluecamel dot eml dot cc
15 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
8 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    条目已被删除
To Top