<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Predefined Constants</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="zip.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="zip.examples.html">Examples</a></div> <div class="up"><a href="book.zip.html">Zip</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="zip.constants" class="appendix"> <h1>Predefined Constants</h1> <p class="simpara"> The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. </p> <p class="para"> <a href="class.ziparchive.html" class="classname">ZipArchive</a> uses class constants. There are three types of constants : Flags (prefixed with <em>FL_</em>), errors (prefixed with <em>ER_</em>) and mode (no prefix). </p> <dl> <dt id="ziparchive.constants.create"> <strong><code>ZipArchive::CREATE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Create the archive if it does not exist. </span> </dd> <dt id="ziparchive.constants.overwrite"> <strong><code>ZipArchive::OVERWRITE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> If archive exists, ignore its current contents. In other words, handle it the same way as an empty archive. </span> </dd> <dt id="ziparchive.constants.excl"> <strong><code>ZipArchive::EXCL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Error if archive already exists. </span> </dd> <dt id="ziparchive.constants.checkcons"> <strong><code>ZipArchive::CHECKCONS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Perform additional consistency checks on the archive, and error if they fail. </span> </dd> <dt id="ziparchive.constants.fl-nocase"> <strong><code>ZipArchive::FL_NOCASE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Ignore case on name lookup </span> </dd> <dt id="ziparchive.constants.fl-nodir"> <strong><code>ZipArchive::FL_NODIR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Ignore directory component </span> </dd> <dt id="ziparchive.constants.fl-compressed"> <strong><code>ZipArchive::FL_COMPRESSED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Read compressed data </span> </dd> <dt id="ziparchive.constants.fl-unchanged"> <strong><code>ZipArchive::FL_UNCHANGED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Use original data, ignoring changes. </span> </dd> <dt id="ziparchive.constants.fl-enc-guess"> <strong><code>ZipArchive::FL_ENC_GUESS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Guess string encoding (is default). Available as of PHP 7.0.8. </span> </dd> <dt id="ziparchive.constants.fl-enc-raw"> <strong><code>ZipArchive::FL_ENC_RAW</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Get unmodified string. Available as of PHP 7.0.8. </span> </dd> <dt id="ziparchive.constants.fl-enc-strict"> <strong><code>ZipArchive::FL_ENC_STRICT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Follow specification strictly. Available as of PHP 7.0.8. </span> </dd> <dt id="ziparchive.constants.fl-enc-utf8"> <strong><code>ZipArchive::FL_ENC_UTF_8</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> String is UTF-8 encoded. Available as of PHP 7.0.8. </span> </dd> <dt id="ziparchive.constants.fl-enc-cp437"> <strong><code>ZipArchive::FL_ENC_CP437</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> String is CP437 encoded. Available as of PHP 7.0.8. </span> </dd> <dt id="ziparchive.constants.cm-default"> <strong><code>ZipArchive::CM_DEFAULT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> better of deflate or store. </span> </dd> <dt id="ziparchive.constants.cm-store"> <strong><code>ZipArchive::CM_STORE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> stored (uncompressed). </span> </dd> <dt id="ziparchive.constants.cm-shrink"> <strong><code>ZipArchive::CM_SHRINK</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> shrunk </span> </dd> <dt id="ziparchive.constants.cm-reduce-1"> <strong><code>ZipArchive::CM_REDUCE_1</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> reduced with factor 1 </span> </dd> <dt id="ziparchive.constants.cm-reduce-2"> <strong><code>ZipArchive::CM_REDUCE_2</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> reduced with factor 2 </span> </dd> <dt id="ziparchive.constants.cm-reduce-3"> <strong><code>ZipArchive::CM_REDUCE_3</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> reduced with factor 3 </span> </dd> <dt id="ziparchive.constants.cm-reduce-4"> <strong><code>ZipArchive::CM_REDUCE_4</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> reduced with factor 4 </span> </dd> <dt id="ziparchive.constants.cm-implode"> <strong><code>ZipArchive::CM_IMPLODE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> imploded </span> </dd> <dt id="ziparchive.constants.cm-deflate"> <strong><code>ZipArchive::CM_DEFLATE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> deflated </span> </dd> <dt id="ziparchive.constants.cm-deflate64"> <strong><code>ZipArchive::CM_DEFLATE64</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> deflate64 </span> </dd> <dt id="ziparchive.constants.cm-pkware-implode"> <strong><code>ZipArchive::CM_PKWARE_IMPLODE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> PKWARE imploding </span> </dd> <dt id="ziparchive.constants.cm-bzip2"> <strong><code>ZipArchive::CM_BZIP2</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> BZIP2 algorithm </span> </dd> <dt id="ziparchive.constants.er-ok"> <strong><code>ZipArchive::ER_OK</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> No error. </span> </dd> <dt id="ziparchive.constants.er-multidisk"> <strong><code>ZipArchive::ER_MULTIDISK</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Multi-disk zip archives not supported. </span> </dd> <dt id="ziparchive.constants.er-rename"> <strong><code>ZipArchive::ER_RENAME</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Renaming temporary file failed. </span> </dd> <dt id="ziparchive.constants.er-close"> <strong><code>ZipArchive::ER_CLOSE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Closing zip archive failed </span> </dd> <dt id="ziparchive.constants.er-seek"> <strong><code>ZipArchive::ER_SEEK</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Seek error </span> </dd> <dt id="ziparchive.constants.er-read"> <strong><code>ZipArchive::ER_READ</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Read error </span> </dd> <dt id="ziparchive.constants.er-write"> <strong><code>ZipArchive::ER_WRITE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Write error </span> </dd> <dt id="ziparchive.constants.er-crc"> <strong><code>ZipArchive::ER_CRC</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> CRC error </span> </dd> <dt id="ziparchive.constants.er-zipclosed"> <strong><code>ZipArchive::ER_ZIPCLOSED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Containing zip archive was closed </span> </dd> <dt id="ziparchive.constants.er-noent"> <strong><code>ZipArchive::ER_NOENT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> No such file. </span> </dd> <dt id="ziparchive.constants.er-exists"> <strong><code>ZipArchive::ER_EXISTS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> File already exists </span> </dd> <dt id="ziparchive.constants.er-open"> <strong><code>ZipArchive::ER_OPEN</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Can't open file </span> </dd> <dt id="ziparchive.constants.er-tmpopen"> <strong><code>ZipArchive::ER_TMPOPEN</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Failure to create temporary file. </span> </dd> <dt id="ziparchive.constants.er-zlib"> <strong><code>ZipArchive::ER_ZLIB</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Zlib error </span> </dd> <dt id="ziparchive.constants.er-memory"> <strong><code>ZipArchive::ER_MEMORY</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Memory allocation failure </span> </dd> <dt id="ziparchive.constants.er-changed"> <strong><code>ZipArchive::ER_CHANGED</code></strong> (<span class="type"><a href="language.types.string.html" class="type string">string</a></span>) </dt> <dd> <span class="simpara"> Entry has been changed </span> </dd> <dt id="ziparchive.constants.er-compnotsupp"> <strong><code>ZipArchive::ER_COMPNOTSUPP</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Compression method not supported. </span> </dd> <dt id="ziparchive.constants.er-eof"> <strong><code>ZipArchive::ER_EOF</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Premature EOF </span> </dd> <dt id="ziparchive.constants.er-inval"> <strong><code>ZipArchive::ER_INVAL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Invalid argument </span> </dd> <dt id="ziparchive.constants.er-nozip"> <strong><code>ZipArchive::ER_NOZIP</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Not a zip archive </span> </dd> <dt id="ziparchive.constants.er-internal"> <strong><code>ZipArchive::ER_INTERNAL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Internal error </span> </dd> <dt id="ziparchive.constants.er-incons"> <strong><code>ZipArchive::ER_INCONS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Zip archive inconsistent </span> </dd> <dt id="ziparchive.constants.er-remove"> <strong><code>ZipArchive::ER_REMOVE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Can't remove file </span> </dd> <dt id="ziparchive.constants.er-deleted"> <strong><code>ZipArchive::ER_DELETED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Entry has been deleted </span> </dd> <dt id="ziparchive.constants.em-none"> <strong><code>ZipArchive::EM_NONE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> No encryption, since PHP 7.2.0, PECL zip 1.14.0 </span> </dd> <dt id="ziparchive.constants.em-aez-128"> <strong><code>ZipArchive::EM_AES_128</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> AES 128 encryption, since PHP 7.2.0, PECL zip 1.14.0 </span> </dd> <dt id="ziparchive.constants.em-aez-192"> <strong><code>ZipArchive::EM_AES_192</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> AES 1192 encryption, since PHP 7.2.0, PECL zip 1.14.0 </span> </dd> <dt id="ziparchive.constants.em-aes256"> <strong><code>ZipArchive::EM_AES_256</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> AES 256 encryption, since PHP 7.2.0, PECL zip 1.14.0 </span> </dd> </dl> <dl> <strong class="title">Operating system constants for external attributes</strong> <dt id="ziparchive.constants.opsys.default"> <strong><code>ZipArchive::OPSYS_DOS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_AMIGA</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_OPENVMS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_UNIX</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_VM_CMS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_ATARI_ST</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_OS_2</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_MACINTOSH</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_Z_SYSTEM</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_CPM</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_WINDOWS_NTFS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_MVS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_VSE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_ACORN_RISC</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_VFAT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_ALTERNATE_MVS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_BEOS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_TANDEM</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_OS_400</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_OS_X</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dt> <strong><code>ZipArchive::OPSYS_DEFAULT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </dt> <dd> <span class="simpara"> Since PHP 5.6.0, PECL zip 1.12.4 </span> </dd> </dl> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="zip.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="zip.examples.html">Examples</a></div> <div class="up"><a href="book.zip.html">Zip</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>