<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.xdiff.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.xdiff-file-rabdiff.php',
    1 => 'xdiff_file_rabdiff',
    2 => 'Make binary diff of two files using the Rabin\'s polynomial fingerprinting algorithm',
  ),
  'up' => 
  array (
    0 => 'ref.xdiff.php',
    1 => 'xdiff 函数',
  ),
  'prev' => 
  array (
    0 => 'function.xdiff-file-patch-binary.php',
    1 => 'xdiff_file_patch_binary',
  ),
  'next' => 
  array (
    0 => 'function.xdiff-string-bdiff.php',
    1 => 'xdiff_string_bdiff',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/xdiff/functions/xdiff-file-rabdiff.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.xdiff-file-rabdiff" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xdiff_file_rabdiff</h1>
  <p class="verinfo">(PECL xdiff &gt;= 1.5.0)</p><p class="refpurpose"><span class="refname">xdiff_file_rabdiff</span> &mdash; <span class="dc-title">Make binary diff of two files using the Rabin&#039;s polynomial fingerprinting algorithm</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.xdiff-file-rabdiff-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>xdiff_file_rabdiff</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$old_file</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$new_file</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$dest</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Makes a binary diff of two files and stores the result in a patch file.
   The difference between this function and <span class="function"><a href="function.xdiff-file-bdiff.php" class="function">xdiff_file_bdiff()</a></span> is different
   algorithm used which should result in faster execution and smaller diff produced.
   This function works with both text and binary files. Resulting patch
   file can be later applied using <span class="function"><a href="function.xdiff-file-bpatch.php" class="function">xdiff_file_bpatch()</a></span>/<span class="function"><a href="function.xdiff-string-bpatch.php" class="function">xdiff_string_bpatch()</a></span>.
  </p>
  <p class="para">
   For more details about differences between algorithm used please check <a href="http://www.xmailserver.org/xdiff-lib.html" class="link external">&raquo;&nbsp;libxdiff</a> 
   website.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xdiff-file-rabdiff-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">old_file</code></dt>
     <dd>
      <p class="para">
       Path to the first file. This file acts as &quot;old&quot; file.
      </p>
     </dd>
    
    
     <dt><code class="parameter">new_file</code></dt>
     <dd>
      <p class="para">
       Path to the second file. This file acts as &quot;new&quot; file.
      </p>
     </dd>
    
    
     <dt><code class="parameter">dest</code></dt>
     <dd>
      <p class="para">
       Path of the resulting patch file. Resulting file contains differences
       between &quot;old&quot; and &quot;new&quot; files. It is in binary format and is human-unreadable.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xdiff-file-rabdiff-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.xdiff-file-rabdiff-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="function"><strong>xdiff_file_rabdiff()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     The following code makes binary diff of two archives.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$old_version </span><span style="color: #007700">= </span><span style="color: #DD0000">'my_script_1.0.tgz'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$new_version </span><span style="color: #007700">= </span><span style="color: #DD0000">'my_script_1.1.tgz'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">xdiff_file_rabdiff</span><span style="color: #007700">(</span><span style="color: #0000BB">$old_version</span><span style="color: #007700">, </span><span style="color: #0000BB">$new_version</span><span style="color: #007700">, </span><span style="color: #DD0000">'my_script.bdiff'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.xdiff-file-rabdiff-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    Both files will be loaded into memory so ensure that your memory_limit is
    set high enough.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.xdiff-file-rabdiff-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.xdiff-file-bpatch.php" class="function" rel="rdfs-seeAlso">xdiff_file_bpatch()</a> - Patch a file with a binary diff</span></li>
   </ul>
  </p>
 </div>


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