<!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>Compression Streams</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="wrappers.php.html">php://</a></div> <div class="next" style="text-align: right; float: right;"><a href="wrappers.data.html">data://</a></div> <div class="up"><a href="wrappers.html">Supported Protocols and Wrappers</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="wrappers.compression" class="refentry"> <div class="refnamediv"> <h1 class="refname">zlib://</h1> <h1 class="refname">bzip2://</h1> <h1 class="refname">zip://</h1> <p class="refpurpose"><span class="refname">zlib://</span> -- <span class="refname">bzip2://</span> -- <span class="refname">zip://</span> — <span class="dc-title">Compression Streams</span></p> </div> <div class="refsect1 description" id="refsect1-wrappers.compression-description"> <h3 class="title">Description</h3> <p class="simpara"><var class="filename">zlib:</var> PHP 4.0.4 - PHP 4.2.3 (systems with fopencookie only)</p> <p class="simpara"><var class="filename">compress.zlib://</var> and <var class="filename">compress.bzip2://</var> PHP 4.3.0 and up</p> <p class="simpara"> <var class="filename">zlib:</var> works like <span class="function"><a href="function.gzopen.html" class="function">gzopen()</a></span>, except that the stream can be used with <span class="function"><a href="function.fread.html" class="function">fread()</a></span> and the other filesystem functions. This is deprecated as of PHP 4.3.0 due to ambiguities with filenames containing ':' characters; use <var class="filename">compress.zlib://</var> instead. </p> <p class="simpara"> <var class="filename">compress.zlib://</var> and <var class="filename">compress.bzip2://</var> are equivalent to <span class="function"><a href="function.gzopen.html" class="function">gzopen()</a></span> and <span class="function"><a href="function.bzopen.html" class="function">bzopen()</a></span> respectively, and operate even on systems that do not support fopencookie. </p> <p class="para"> <a href="book.zip.html" class="link">ZIP extension</a> registers <var class="filename">zip:</var> wrapper. </p> </div> <div class="refsect1 usage" id="refsect1-wrappers.compression-usage"> <h3 class="title">Usage</h3> <ul class="itemizedlist"> <li class="listitem"><span class="simpara"><var class="filename">compress.zlib://file.gz</var></span></li> <li class="listitem"><span class="simpara"><var class="filename">compress.bzip2://file.bz2</var></span></li> <li class="listitem"><span class="simpara"><var class="filename">zip://archive.zip#dir/file.txt</var></span></li> </ul> </div> <div class="refsect1 options" id="refsect1-wrappers.compression-options"> <h3 class="title">Options</h3> <p class="para"> <table class="doctable table"> <caption><strong>Wrapper Summary</strong></caption> <thead> <tr> <th>Attribute</th> <th>Supported</th> </tr> </thead> <tbody class="tbody"> <tr> <td>Restricted by <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">allow_url_fopen</a></td> <td>No</td> </tr> <tr> <td>Allows Reading</td> <td>Yes</td> </tr> <tr> <td>Allows Writing</td> <td>Yes (except <em>zip://</em>)</td> </tr> <tr> <td>Allows Appending</td> <td>Yes (except <em>zip://</em>)</td> </tr> <tr> <td>Allows Simultaneous Reading and Writing</td> <td>No</td> </tr> <tr> <td>Supports <span class="function"><a href="function.stat.html" class="function">stat()</a></span></td> <td> No, use the normal <em>file://</em> wrapper to stat compressed files. </td> </tr> <tr> <td>Supports <span class="function"><a href="function.unlink.html" class="function">unlink()</a></span></td> <td> No, use the normal <em>file://</em> wrapper to unlink compressed files. </td> </tr> <tr> <td>Supports <span class="function"><a href="function.rename.html" class="function">rename()</a></span></td> <td>No</td> </tr> <tr> <td>Supports <span class="function"><a href="function.mkdir.html" class="function">mkdir()</a></span></td> <td>No</td> </tr> <tr> <td>Supports <span class="function"><a href="function.rmdir.html" class="function">rmdir()</a></span></td> <td>No</td> </tr> </tbody> </table> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="wrappers.php.html">php://</a></div> <div class="next" style="text-align: right; float: right;"><a href="wrappers.data.html">data://</a></div> <div class="up"><a href="wrappers.html">Supported Protocols and Wrappers</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>