<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.zlib.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.deflate-init.php',
    1 => 'deflate_init',
    2 => 'インクリメンタルな圧縮コンテキストを初期化する',
  ),
  'up' => 
  array (
    0 => 'ref.zlib.php',
    1 => 'Zlib 関数',
  ),
  'prev' => 
  array (
    0 => 'function.deflate-add.php',
    1 => 'deflate_add',
  ),
  'next' => 
  array (
    0 => 'function.gzclose.php',
    1 => 'gzclose',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/zlib/functions/deflate_init.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.deflate-init" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">deflate_init</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">deflate_init</span> &mdash; <span class="dc-title">インクリメンタルな圧縮コンテキストを初期化する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.deflate-init-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>deflate_init</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$encoding</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.object.php" class="type object">object</a></span></span> <code class="parameter">$options</code><span class="initializer"> = []</span></span>): <span class="type"><span class="type"><a href="class.deflatecontext.php" class="type DeflateContext">DeflateContext</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   指定された <code class="parameter">encoding</code> を使って
   インクリメンタルな圧縮コンテキストを初期化します。
  </p>
  <p class="para">
   <code class="literal">window</code> オプションは、
   アルゴリズムのウィンドウサイズだけを設定することに注意してください。
   これは、同じパラメータが利用するエンコーディングも設定する zlib filter と異なります。
   この関数では、エンコーディングは <code class="parameter">encoding</code> で指定しなければなりません。
  </p>
  <p class="para">
   制限: GZIP 圧縮されたストリームにヘッダ情報を設定する方法が現状は存在しません。
   これは、次のようにして設定されます:
   GZIP シグネチャ
   (<code class="literal">\x1f\x8B</code>); 圧縮メソッド (<code class="literal">\x08</code>
   == DEFLATE); 6 個のゼロバイト; 現在のオペレーティングシステム
   (<code class="literal">\x00</code> = Windows, <code class="literal">\x03</code> = Unix, など)
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.deflate-init-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">encoding</code></dt>
    <dd>
     <p class="para">
      定数 <strong><code><a href="zlib.constants.php#constant.zlib-encoding-raw">ZLIB_ENCODING_<span class="replaceable">*</span></a></code></strong> のうちのひとつ
     </p>
    </dd>
   
   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <p class="para">
      以下の要素を含む連想配列:
      <dl>
       
        <dt><var class="varname">level</var></dt>
        <dd>
         <p class="para">
          -1 .. 9 までの圧縮レベル。デフォルトは -1 です。
         </p>
        </dd>
       
       
        <dt><var class="varname">memory</var></dt>
        <dd>
         <p class="para">
          1 .. 9 までの圧縮メモリレベル。デフォルトは8です。
         </p>
        </dd>
       
       
        <dt><var class="varname">window</var></dt>
        <dd>
         <p class="para">
          <code class="literal">8</code> .. <code class="literal">15</code> までの zlib の window サイズ(対数)。
          デフォルトは 15 です。
          zlib 1.2.8 以降では、
          window サイズ <code class="literal">8</code> が
          <strong><code><a href="zlib.constants.php#constant.zlib-encoding-raw">ZLIB_ENCODING_RAW</a></code></strong> や <strong><code><a href="zlib.constants.php#constant.zlib-encoding-gzip">ZLIB_ENCODING_GZIP</a></code></strong>
          と一緒に指定された場合、この関数は失敗し、警告が発生します。
          同時に、zlib は window サイズを <code class="literal">8</code> から <code class="literal">9</code> に変更します。
         </p>
        </dd>
       
       
        <dt><var class="varname">strategy</var></dt>
        <dd>
         <p class="para">
          <strong><code><a href="zlib.constants.php#constant.zlib-filtered">ZLIB_FILTERED</a></code></strong>,
          <strong><code><a href="zlib.constants.php#constant.zlib-huffman-only">ZLIB_HUFFMAN_ONLY</a></code></strong>, <strong><code><a href="zlib.constants.php#constant.zlib-rle">ZLIB_RLE</a></code></strong>,
          <strong><code><a href="zlib.constants.php#constant.zlib-fixed">ZLIB_FIXED</a></code></strong>,
          <strong><code><a href="zlib.constants.php#constant.zlib-default-strategy">ZLIB_DEFAULT_STRATEGY</a></code></strong> (デフォルト)
          のうちのいずれか。
         </p>
        </dd>
       
       
        <dt><var class="varname">dictionary</var></dt>
        <dd>
         <p class="para">
          あらかじめ設定されたディクショナリの
          <span class="type"><a href="language.types.string.php" class="type string">string</a></span> または
          <span class="type">strings</span> の <span class="type"><a href="language.types.array.php" class="type array">array</a></span>。
          (デフォルト: 辞書なし)
         </p>
        </dd>
       
      </dl>
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.deflate-init-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合、圧縮コンテキストリソース(<code class="literal">zlib.deflate</code>) を返します。
   失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.deflate-init-errors">
  <h3 class="title">エラー / 例外</h3>
  <p class="para">
   不正なオプションが <code class="parameter">options</code> に渡されたり、
   コンテキストが作れなかった場合には、 <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> レベルのエラーが発生します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.deflate-init-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       成功時に、この関数は
       <span class="classname"><a href="class.deflatecontext.php" class="classname">DeflateContext</a></span> クラスのインスタンスを返すようになりました。
       これより前のバージョンでは、<span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> を返していました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.deflate-init-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.deflate-add.php" class="function" rel="rdfs-seeAlso">deflate_add()</a> - インクリメンタルにデータを圧縮する</span></li>
   <li><span class="function"><a href="function.inflate-init.php" class="function" rel="rdfs-seeAlso">inflate_init()</a> - インクリメンタルな解凍コンテキストを初期化する</span></li>
  </ul>
 </div>


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