<!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>Alias of xdiff_file_bpatch</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.xdiff-file-merge3.html">xdiff_file_merge3</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.xdiff-file-patch.html">xdiff_file_patch</a></div> <div class="up"><a href="ref.xdiff.html">xdiff Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.xdiff-file-patch-binary" class="refentry"> <div class="refnamediv"> <h1 class="refname">xdiff_file_patch_binary</h1> <p class="verinfo">(PECL xdiff >= 0.2.0)</p><p class="refpurpose"><span class="refname">xdiff_file_patch_binary</span> — <span class="dc-title">Alias of xdiff_file_bpatch</span></p> </div> <div class="refsect1 description" id="refsect1-function.xdiff-file-patch-binary-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>xdiff_file_patch_binary</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$file</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$patch</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$dest</code></span> )</div> <p class="para rdfs-comment"> Patches a <em><code class="parameter">file</code></em> with a binary <em><code class="parameter">patch</code></em> and stores the result in a file <em><code class="parameter">dest</code></em>. This function accepts patches created both via <span class="function"><a href="function.xdiff-file-bdiff.html" class="function">xdiff_file_bdiff()</a></span> or <span class="function"><a href="function.xdiff-file-rabdiff.html" class="function">xdiff_file_rabdiff()</a></span> functions or their string counterparts. </p> <p class="para"> Starting with version 1.5.0 this function is an alias of <span class="function"><a href="function.xdiff-file-bpatch.html" class="function">xdiff_file_bpatch()</a></span>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.xdiff-file-patch-binary-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">file</code></em></span> <dd> <p class="para"> The original file. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">patch</code></em></span> <dd> <p class="para"> The binary patch file. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">dest</code></em></span> <dd> <p class="para"> Path of the resulting file. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.xdiff-file-patch-binary-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 examples" id="refsect1-function.xdiff-file-patch-binary-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2455"> <p><strong>Example #1 <span class="function"><strong>xdiff_file_patch_binary()</strong></span> example</strong></p> <div class="example-contents"><p> The following code applies binary diff to a file. </p></div> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$old_version </span><span style="color: #007700">= </span><span style="color: #DD0000">'archive-1.0.tgz'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$patch </span><span style="color: #007700">= </span><span style="color: #DD0000">'archive.bpatch'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">xdiff_file_patch_binary</span><span style="color: #007700">(</span><span style="color: #0000BB">$old_version</span><span style="color: #007700">, </span><span style="color: #0000BB">$patch</span><span style="color: #007700">, </span><span style="color: #DD0000">'archive-1.1.tgz'</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$result</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"File patched"</span><span style="color: #007700">;<br />} else {<br /> echo </span><span style="color: #DD0000">"File couldn't be patched"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-function.xdiff-file-patch-binary-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Both files (<em><code class="parameter">file</code></em> and <em><code class="parameter">patch</code></em>) 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-patch-binary-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.xdiff-string-patch-binary.html" class="function" rel="rdfs-seeAlso">xdiff_string_patch_binary()</a> - Alias of xdiff_string_bpatch</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.xdiff-file-merge3.html">xdiff_file_merge3</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.xdiff-file-patch.html">xdiff_file_patch</a></div> <div class="up"><a href="ref.xdiff.html">xdiff Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>