Our source is open
The syntax highlighted source is automatically generated by PHP from
the plaintext script.
If you're interested in what's behind the several functions we
used, you can always take a look at the source of the following files:
Of course, if you want to see the source
of this page, we have it available.
You can also browse the SVN repository for this website on
svn.php.net.
Source of: /manual/en/function.xdiff-string-bdiff-size.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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 => 'en',
),
'this' =>
array (
0 => 'function.xdiff-string-bdiff-size.php',
1 => 'xdiff_string_bdiff_size',
),
'up' =>
array (
0 => 'ref.xdiff.php',
1 => 'xdiff Functions',
),
'prev' =>
array (
0 => 'function.xdiff-file-rabdiff.php',
1 => 'xdiff_file_rabdiff',
),
'next' =>
array (
0 => 'function.xdiff-string-bdiff.php',
1 => 'xdiff_string_bdiff',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.xdiff-string-bdiff-size" class="refentry">
<div class="refnamediv">
<h1 class="refname">xdiff_string_bdiff_size</h1>
<p class="verinfo">(PECL xdiff >= 0.2.0)</p><p class="refpurpose"><span class="refname">xdiff_string_bdiff_size</span> — <span class="dc-title">Read a size of file created by applying a binary diff</span></p>
</div>
<a name="function.xdiff-string-bdiff-size.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">int</span> <span class="methodname"><b>xdiff_string_bdiff_size</b></span>
( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$patch</tt></span>
)</div>
<p class="para rdfs-comment">
Returns a size of a result file that would be created after applying binary <i><tt class="parameter">patch</tt></i>
to
the original file.
</p>
</div>
<a name="function.xdiff-string-bdiff-size.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">patch</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The binary patch created by <a href="function.xdiff-string-bdiff.php" class="function">xdiff_string_bdiff()</a> or
<a href="function.xdiff-string-rabdiff.php" class="function">xdiff_string_rabdiff()</a> function.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.xdiff-string-bdiff-size.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns the size of file that would be created.
</p>
</div>
<a name="function.xdiff-string-bdiff-size.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <b>xdiff_string_bdiff_size()</b> example</b></p>
<div class="example-contents para"><p>
The following code applies reads a size of file that would be created
after applying a binary diff.
</p></div>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br />$binary_patch </span><span style="color: #007700">= </span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">'file.bdiff'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$length </span><span style="color: #007700">= </span><span style="color: #0000BB">xdiff_string_bdiff_size</span><span style="color: #007700">(</span><span style="color: #0000BB">$binary_patch</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"Resulting file will be </span><span style="color: #0000BB">$length</span><span style="color: #DD0000"> bytes long"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
</div><p>
</p>
</div>
<a name="function.xdiff-string-bdiff-size.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.xdiff-string-bdiff.php" class="function" rel="rdfs-seeAlso">xdiff_string_bdiff()</a> - Make binary diff of two strings</li>
<li class="member"><a href="function.xdiff-string-rabdiff.php" class="function" rel="rdfs-seeAlso">xdiff_string_rabdiff()</a> - Make binary diff of two strings using the Rabin's polynomial fingerprinting algorithm</li>
<li class="member"><a href="function.xdiff-string-bpatch.php" class="function" rel="rdfs-seeAlso">xdiff_string_bpatch()</a> - Patch a string with a binary diff</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>