<!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="phar.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="phar.using.html">Using Phar Archives</a></div> <div class="up"><a href="book.phar.html">Phar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="phar.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> <table id="phar.constants.compression" class="doctable table"> <caption><strong>Phar compression constants</strong></caption> <thead> <tr> <th>Constant</th> <th>Value</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr id="phar.constants.none"> <td> <strong><code>Phar::NONE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x00000000</td> <td>no compression</td> </tr> <tr id="phar.constants.compressed"> <td> <strong><code>Phar::COMPRESSED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x0000F000</td> <td>bitmask that can be used with file flags to determine if any compression is present</td> </tr> <tr id="phar.constants.gz"> <td> <strong><code>Phar::GZ</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x00001000</td> <td>zlib (gzip) compression</td> </tr> <tr id="phar.constants.bz2"> <td> <strong><code>Phar::BZ2</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x00002000</td> <td>bzip2 compression</td> </tr> </tbody> </table> <table id="phar.constants.fileformat" class="doctable table"> <caption><strong>Phar file format constants</strong></caption> <thead> <tr> <th>Constant</th> <th>Value</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr id="phar.constants.same"> <td> <strong><code>Phar::SAME</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0</td> <td>retain the same file format</td> </tr> <tr id="phar.constants.phar"> <td> <strong><code>Phar::PHAR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>1</td> <td>phar file format</td> </tr> <tr id="phar.constants.tar"> <td> <strong><code>Phar::TAR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>2</td> <td>tar file format</td> </tr> <tr id="phar.constants.zip"> <td> <strong><code>Phar::ZIP</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>3</td> <td>zip file format</td> </tr> </tbody> </table> <table id="phar.constants.signature" class="doctable table"> <caption><strong>Phar signature constants</strong></caption> <thead> <tr> <th>Constant</th> <th>Value</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr id="phar.constants.md5"> <td> <strong><code>Phar::MD5</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x0001</td> <td>signature with md5 hash algorithm</td> </tr> <tr id="phar.constants.sha1"> <td> <strong><code>Phar::SHA1</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x0002</td> <td>signature with sha1 hash algorithm</td> </tr> <tr id="phar.constants.sha256"> <td> <strong><code>Phar::SHA256</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x0003</td> <td>signature with sha256 hash algorithm (requires hash extension)</td> </tr> <tr id="phar.constants.sha512"> <td> <strong><code>Phar::SHA512</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x0004</td> <td>signature with sha512 hash algorithm (requires hash extension)</td> </tr> <tr id="phar.constants.openssl"> <td> <strong><code>Phar::OPENSSL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>0x0010</td> <td>signature with OpenSSL public/private key pair. This is a true, asymmetric key signature.</td> </tr> </tbody> </table> <table id="phar.constants.mimeoverride" class="doctable table"> <caption><strong>Phar webPhar mime override constants</strong></caption> <thead> <tr> <th>Constant</th> <th>Value</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr id="phar.constants.php"> <td> <strong><code>Phar::PHP</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>1</td> <td>used to instruct the mimeoverrides parameter of <span class="function"><a href="phar.webphar.html" class="function">Phar::webPhar()</a></span> that the extension should be parsed as a PHP file</td> </tr> <tr id="phar.constants.phps"> <td> <strong><code>Phar::PHPS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>) </td> <td>2</td> <td>used to instruct the mimeoverrides parameter of <span class="function"><a href="phar.webphar.html" class="function">Phar::webPhar()</a></span> that the extension should be parsed as a PHP source file through <span class="function"><a href="function.highlight-file.html" class="function">highlight_file()</a></span></td> </tr> </tbody> </table> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="phar.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="phar.using.html">Using Phar Archives</a></div> <div class="up"><a href="book.phar.html">Phar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>