<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/wrappers.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'wrappers.compression.php',
    1 => 'zlib://',
    2 => 'Compression Streams',
  ),
  'up' => 
  array (
    0 => 'wrappers.php',
    1 => 'Supported Protocols and Wrappers',
  ),
  'prev' => 
  array (
    0 => 'wrappers.php.php',
    1 => 'php://',
  ),
  'next' => 
  array (
    0 => 'wrappers.data.php',
    1 => 'data://',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/wrappers/compression.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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> &mdash; <span class="dc-title">Compression Streams</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-wrappers.compression-description">
  <h3 class="title">Descrizione</h3>
  <p class="simpara"><var class="filename">compress.zlib://</var> and <var class="filename">compress.bzip2://</var></p>

  <p class="simpara">
   <var class="filename">zlib:</var> works like <span class="function"><a href="function.gzopen.php" class="function">gzopen()</a></span>, except that the
   stream can be used with <span class="function"><a href="function.fread.php" class="function">fread()</a></span> and the other
   filesystem functions.  This is deprecated due
   to ambiguities with filenames containing &#039;:&#039; 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.php" class="function">gzopen()</a></span> and <span class="function"><a href="function.bzopen.php" class="function">bzopen()</a></span>
   respectively, and operate even on systems that do not support
   fopencookie.
  </p>

  <p class="simpara">
   <a href="book.zip.php" class="link">ZIP extension</a> registers <var class="filename">zip:</var> wrapper. As of
   PHP 7.2.0 and libzip 1.2.0+, support for the passwords for encrypted archives were added, allowing
   passwords to be supplied by stream contexts. Passwords can be set using the <code class="literal">&#039;password&#039;</code>
   stream context option.
  </p>
 </div>


 <div class="refsect1 usage" id="refsect1-wrappers.compression-usage"> 
  <h3 class="title">Utilizzo</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">Opzioni</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.php#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 <code class="literal">zip://</code>)</td>
      </tr>

      <tr>
       <td>Allows Appending</td>
       <td>Yes (except <code class="literal">zip://</code>)</td>
      </tr>

      <tr>
       <td>Allows Simultaneous Reading and Writing</td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.stat.php" class="function">stat()</a></span></td>
       <td>
        No, use the normal <code class="literal">file://</code> wrapper
        to stat compressed files.
       </td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.unlink.php" class="function">unlink()</a></span></td>
       <td>
        No, use the normal <code class="literal">file://</code> wrapper
        to unlink compressed files.
       </td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.rename.php" class="function">rename()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.mkdir.php" class="function">mkdir()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.rmdir.php" class="function">rmdir()</a></span></td>
       <td>No</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>
 

 <div class="refsect1 seealso" id="refsect1-wrappers.compression-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><a href="context.zlib.php" class="xref">Opzioni di contesto Zlib</a></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>