Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 3165

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!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>Initialize an incremental deflate context</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.deflate-add.html">deflate_add</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.gzclose.html">gzclose</a></div>
 <div class="up"><a href="ref.zlib.html">Zlib Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.deflate-init" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">deflate_init</h1>
  <p class="verinfo">(PHP 7)</p><p class="refpurpose"><span class="refname">deflate_init</span> &mdash; <span class="dc-title">Initialize an incremental deflate context</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.deflate-init-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">resource</span> <span class="methodname"><strong>deflate_init</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$encoding</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code><span class="initializer"> = array()</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Initializes an incremental deflate context using the specified
   <code class="parameter">encoding</code>.
  </p>
  <p class="para">
   Note that the <em>window</em> option here only sets the window size
   of the algorithm, differently from the zlib filters where the same parameter
   also sets the encoding to use; the encoding must be set with the
   <code class="parameter">encoding</code> parameter.
  </p>
  <p class="para">
   Limitation: there is currently no way to set the header information on a GZIP
   compressed stream, which are set as follows: GZIP signature
   (<em>\x1f\x8B</em>); compression method (<em>\x08</em>
   == DEFLATE); 6 zero bytes; the operating system set to the current system
   (<em>\x00</em> = Windows, <em>\x03</em> = Unix, etc.)
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.deflate-init-parameters">
  <h3 class="title">Parameters</h3>
  <dl>

   
    <dt>
<code class="parameter">encoding</code></dt>

    <dd>

     <p class="para">
      One of the <strong><code>ZLIB_ENCODING_*</code></strong> constants.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">options</code></dt>

    <dd>

     <p class="para">
      An associative array which may contain the following elements:
      <dl>

       
        <dt>
<var class="varname"><var class="varname">level</var></var></dt>

        <dd>

         <p class="para">
          The compression level in range -1..9; defaults to -1.
         </p>
        </dd>

       
       
        <dt>
<var class="varname"><var class="varname">memory</var></var></dt>

        <dd>

         <p class="para">
          The compression memory level in range 1..9; defaults to 8.
         </p>
        </dd>

       
       
        <dt>
<var class="varname"><var class="varname">window</var></var></dt>

        <dd>

         <p class="para">
          The zlib window size (logarithmic) in range 8..15; defaults to 15.
         </p>
        </dd>

       
       
        <dt>
<var class="varname"><var class="varname">strategy</var></var></dt>

        <dd>

         <p class="para">
          One of <strong><code>ZLIB_FILTERED</code></strong>,
          <strong><code>ZLIB_HUFFMAN_ONLY</code></strong>, <strong><code>ZLIB_RLE</code></strong>,
          <strong><code>ZLIB_FIXED</code></strong> or
          <strong><code>ZLIB_DEFAULT_STRATEGY</code></strong> (the default).
         </p>
        </dd>

       
       
        <dt>
<var class="varname"><var class="varname">dictionary</var></var></dt>

        <dd>

         <p class="para">
          A <span class="type"><a href="language.types.string.html" class="type string">string</a></span> or an <span class="type"><a href="language.types.array.html" class="type array">array</a></span> of <span class="type"><span class="type strings">strings</span></span>
          of the preset dictionary (default: no preset dictionary).
         </p>
        </dd>

       
      </dl>

     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.deflate-init-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns a deflate context resource (<em>zlib.deflate</em>) on
   success,  or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.deflate-init-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   If an invalid option is passed to <code class="parameter">options</code> or the
   context couldn&#039;t be created, an error of level <strong><code>E_WARNING</code></strong>
   is generated.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.deflate-init-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.deflate-add.html" class="function" rel="rdfs-seeAlso">deflate_add()</a> - Incrementally deflate data</span></li>
   <li class="member"><span class="function"><a href="function.inflate-init.html" class="function" rel="rdfs-seeAlso">inflate_init()</a> - Initialize an incremental inflate context</span></li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.deflate-add.html">deflate_add</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.gzclose.html">gzclose</a></div>
 <div class="up"><a href="ref.zlib.html">Zlib Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>