Skip to content

Commit bcac80d

Browse files
committed
Fix incorrect function name and description for xdiff_string_rabdiff() / Fix union type tagging for xdiff_string_rabdiff()
php/doc-en@1987020 php/doc-en@480cc8a
1 parent fb59b45 commit bcac80d

File tree

1 file changed

+46
-18
lines changed

1 file changed

+46
-18
lines changed

reference/xdiff/functions/xdiff-string-rabdiff.xml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 4754397753fd79f1c846868b66a2448babab1c54 Maintainer: takagi Status: ready -->
4-
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
3+
<!-- EN-Revision: 480cc8a9efdb0d2cb1a12bc5c3bab80875a099ee Maintainer: takagi Status: ready -->
54
<refentry xml:id="function.xdiff-string-rabdiff" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
65
<refnamediv>
76
<refname>xdiff_string_rabdiff</refname>
8-
<refpurpose>2 つの文字列のバイナリ diff を、Rabin の polynomial fingerprinting アルゴリズムで作成する</refpurpose>
7+
<refpurpose>
8+
2 つの文字列のバイナリ diff を、Rabin の polynomial fingerprinting アルゴリズムで作成する
9+
</refpurpose>
910
</refnamediv>
10-
11+
1112
<refsect1 role="description">
1213
&reftitle.description;
1314
<methodsynopsis>
14-
<type>string</type><methodname>xdiff_string_bdiff</methodname>
15+
<type class="union"><type>string</type><type>false</type></type><methodname>xdiff_string_rabdiff</methodname>
1516
<methodparam><type>string</type><parameter>old_data</parameter></methodparam>
1617
<methodparam><type>string</type><parameter>new_data</parameter></methodparam>
1718
</methodsynopsis>
1819
<para>
19-
ふたつの文字列のバイナリ diff を作成して結果を返します。
20+
ふたつの文字列のバイナリ diff を生成します。
21+
<link xlink:href="&url.xdiff;">libxdiff</link>
22+
によって実装された Rabin の polynomial fingerprinting
23+
アルゴリズムを使用します。
2024
この関数と <function>xdiff_string_bdiff</function> との違いは、
21-
使用するアルゴリズムです。この関数のほうが実行速度が速く、より小さな diff を生成します。
25+
使用するアルゴリズムです。この関数のほうが実行速度が速く、
26+
より小さな diff を生成します。
27+
また、パッチを適用する際に用いる <function>xdiff_string_bpatch</function> や
28+
<function>xdiff_file_bpatch</function> と完全な互換性があります。
29+
</para>
30+
<para>
2231
この関数はテキストファイルとバイナリファイルの両方に適用可能です。
23-
できあがったパッチファイルを後で適用するには
24-
<function>xdiff_string_bpatch</function>/<function>xdiff_file_bpatch</function>
25-
を使用します。
32+
生成された diff データは後に適用することで、
33+
古いバージョンから新しいバージョンを再構築できます。
2634
</para>
2735
<para>
28-
アルゴリズムの違いについての詳細は、
29-
<link xlink:href="&url.xdiff;">libxdiff</link>
30-
のウェブサイトを参照ください。
36+
アルゴリズムの詳細は、
37+
<link xlink:href="https://www.xmailserver.org/xdiff-lib.html">libxdiff documentation</link> を参照ください。
3138
</para>
3239
</refsect1>
3340

@@ -39,15 +46,15 @@
3946
<term><parameter>old_data</parameter></term>
4047
<listitem>
4148
<para>
42-
バイナリデータを含む最初の文字列。"旧" データです。
49+
"旧" バイナリデータを含む最初の文字列
4350
</para>
4451
</listitem>
4552
</varlistentry>
4653
<varlistentry>
4754
<term><parameter>new_data</parameter></term>
4855
<listitem>
4956
<para>
50-
バイナリデータを含む 2 番目の文字列。"新" データです。
57+
"新" バイナリデータを含む 2 番目の文字列
5158
</para>
5259
</listitem>
5360
</varlistentry>
@@ -58,22 +65,43 @@
5865
<refsect1 role="returnvalues">
5966
&reftitle.returnvalues;
6067
<para>
61-
"旧" データと "新" データの差分を含むバイナリ diff 文字列、
62-
あるいは内部エラーが発生した場合は &false; を返します。
68+
"旧" データと "新" データの差分を含むバイナリ diff 文字列を返します。
69+
&return.falseforfailure;
70+
</para>
71+
</refsect1>
72+
73+
<refsect1 role="examples">
74+
&reftitle.examples;
75+
<para>
76+
<example>
77+
<title>2つの文字列間のバイナリ diff を作成する</title>
78+
<programlisting role="php">
79+
<![CDATA[
80+
<?php
81+
$old = file_get_contents('file_v1.txt');
82+
$new = file_get_contents('file_v2.txt');
83+
84+
$diff = xdiff_string_rabdiff($old, $new);
85+
file_put_contents('patch.rdiff', $diff);
86+
?>
87+
]]>
88+
</programlisting>
89+
</example>
6390
</para>
6491
</refsect1>
6592

6693
<refsect1 role="seealso">
6794
&reftitle.seealso;
6895
<para>
6996
<simplelist>
97+
<member><function>xdiff_string_bdiff</function></member>
7098
<member><function>xdiff_string_bpatch</function></member>
99+
<member><function>xdiff_file_bpatch</function></member>
71100
</simplelist>
72101
</para>
73102
</refsect1>
74103

75104
</refentry>
76-
77105
<!-- Keep this comment at the end of the file
78106
Local variables:
79107
mode: sgml

0 commit comments

Comments
 (0)