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).

ZipArchive::CREATE (integer)
Crea el archivo si no existe.
ZipArchive::OVERWRITE (integer)
Si existe un archivo, ignora su contenido actual. En otras palabras, lo trata de la misma manera que un archivo vacío.
ZipArchive::EXCL (integer)
Error si el fichero ya existe.
ZipArchive::RDONLY (integer)
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 (integer)
Realiza comprobaciones de coherencia adicionales al archivo, producirá un error si falla.
ZipArchive::FL_NOCASE (integer)
Ignorar mayúsculas el lookup del nombre
ZipArchive::FL_NODIR (integer)
Ignorar el componente directorio
ZipArchive::FL_COMPRESSED (integer)
Leer datos comprimidos
ZipArchive::FL_UNCHANGED (integer)
Usar los datos originales, ignorando cambios.
ZipArchive::FL_RECOMPRESS (integer)
Forzar la recompresión de los datos. Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_ENCRYPTED (integer)
Leer datos encriptados (implica FL_COMPRESSED). Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_OVERWRITE (integer)
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 (integer)
En la cabecera local. Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::ZIP_FL_CENTRAL (integer)
En el directorio central. Disponible a partir de PHP 8.0.0 y PECL zip 1.18.0.
ZipArchive::FL_ENC_GUESS (integer)
Codificación de la cadena de suposición (guess string) (predeterminado). Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_RAW (integer)
Obtener la cadena sin modificaciones. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_STRICT (integer)
Seguir la especificación estrictamente. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_UTF_8 (integer)
La cadena está codificada en UTF-8. Disponible a partir de PHP 7.0.8.
ZipArchive::FL_ENC_CP437 (integer)
La cadena está codifica en CP437. Disponible a partir de PHP 7.0.8.
ZipArchive::CM_DEFAULT (integer)
Mejor para desinflar o almacenar.
ZipArchive::CM_STORE (integer)
almacenar (no comprimir).
ZipArchive::CM_SHRINK (integer)
Reducir
ZipArchive::CM_REDUCE_1 (integer)
reducido con factor 1
ZipArchive::CM_REDUCE_2 (integer)
reducido con factor 2
ZipArchive::CM_REDUCE_3 (integer)
reducido con factor 3
ZipArchive::CM_REDUCE_4 (integer)
reducido con factor 4
ZipArchive::CM_IMPLODE (integer)
implodado
ZipArchive::CM_DEFLATE (integer)
Deflactado
ZipArchive::CM_DEFLATE64 (integer)
deflate64
ZipArchive::CM_PKWARE_IMPLODE (integer)
PKWARE imploding
ZipArchive::CM_BZIP2 (integer)
usar algoritmo BZIP2
ZipArchive::CM_LZMA (integer)
Algoritmo LZMA
ZipArchive::CM_LZMA2 (integer)
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_XZ (integer)
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::ER_OK (integer)
Sin errores.
ZipArchive::ER_MULTIDISK (integer)
Archivos zip multi-disk no soportados.
ZipArchive::ER_RENAME (integer)
Mantener fichero temporal fallado.
ZipArchive::ER_CLOSE (integer)
Cerrar fichero zip fallado.
ZipArchive::ER_SEEK (integer)
Buscar error
ZipArchive::ER_READ (integer)
Leer error
ZipArchive::ER_WRITE (integer)
Escribir error
ZipArchive::ER_CRC (integer)
error CRC
ZipArchive::ER_ZIPCLOSED (integer)
Conteniendo el fichero zip que ha sido cerrado
ZipArchive::ER_NOENT (integer)
No existe el fichero.
ZipArchive::ER_EXISTS (integer)
El fichero ya existe
ZipArchive::ER_OPEN (integer)
No se puede abrir el fichero
ZipArchive::ER_TMPOPEN (integer)
Fallo al intentar crear fichero temporal.
ZipArchive::ER_ZLIB (integer)
Error de Zlib
ZipArchive::ER_MEMORY (integer)
Error de asignación de memoria
ZipArchive::ER_CHANGED (string)
La entrada a cambiado
ZipArchive::ER_COMPNOTSUPP (integer)
Método de compresión no soportado.
ZipArchive::ER_EOF (integer)
EOF precoz.
ZipArchive::ER_INVAL (integer)
Argumento inválido
ZipArchive::ER_NOZIP (integer)
No es un archivo zip
ZipArchive::ER_INTERNAL (integer)
Error interno
ZipArchive::ER_INCONS (integer)
Fichero Zip inconsistente
ZipArchive::ER_REMOVE (integer)
No se puede eliminar el fichero
ZipArchive::ER_DELETED (integer)
La entrada ha sido eliminada
ZipArchive::ER_ENCRNOTSUPP (integer)
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 (integer)
Archivo de sólo lectura. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente.
ZipArchive::ER_NOPASSWD (integer)
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 (integer)
Contraseña incorrecta proporcionada. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente.
ZipArchive::ZIP_ER_OPNOTSUPP (integer)
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::ZIP_ER_INUSE (integer)
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::ZIP_ER_TELL (integer)
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::ZIP_ER_COMPRESSED_DATA (integer)
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 (integer)
Operación cancelada. Disponible a partir de PHP 7.4.3 y PECL zip 1.16.1, respectivamente, si se compila con libzip ≥ 1.6.0.
ZipArchive::EM_NONE (integer)
No hay encriptación. 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_128 (integer)
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 (integer)
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 (integer)
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::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 (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)
Desde PHP 5.6.0, PECL zip 1.12.4
add a note add a note

User Contributed Notes 2 notes

up
46
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
5
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