diff --git a/reference/xdiff/functions/xdiff-file-diff-binary.xml b/reference/xdiff/functions/xdiff-file-diff-binary.xml index 55cad72d75..e7d71d5e2b 100644 --- a/reference/xdiff/functions/xdiff-file-diff-binary.xml +++ b/reference/xdiff/functions/xdiff-file-diff-binary.xml @@ -1,5 +1,5 @@ - + @@ -19,11 +19,33 @@ xdiff_file_diff_binary makes binary diff of files file1 and file2 and stores - result in file dest. + result in file dest. This function works with both text + and binary files. Resulting file is in binary format. + + + Both files will be loaded into memory so ensure that your memory_limit is set high enough. + + &return.success; + + <function>xdiff_file_diff_binary</function> example + + The following code makes binary diff of two archives. + + + +]]> + + See also xdiff_string_diff_binary. diff --git a/reference/xdiff/functions/xdiff-file-diff.xml b/reference/xdiff/functions/xdiff-file-diff.xml index 4d2bd72682..9d4631261f 100644 --- a/reference/xdiff/functions/xdiff-file-diff.xml +++ b/reference/xdiff/functions/xdiff-file-diff.xml @@ -1,5 +1,5 @@ - + @@ -25,10 +25,33 @@ context indicated how many lines of context you want to include in diff result. Set minimal to &true; if you want to minimalize size of diff (can take a long time). + Resulting file is human-readable. + + + This function doesn't work well with binary files. To make diff of binary + files use xdiff_file_diff_binary. + + &return.success; + + <function>xdiff_file_diff</function> example + + The following code makes unified diff of two php files. + + + +]]> + + See also xdiff_string_diff. diff --git a/reference/xdiff/functions/xdiff-file-merge3.xml b/reference/xdiff/functions/xdiff-file-merge3.xml index 25d7013b07..38f30e3775 100644 --- a/reference/xdiff/functions/xdiff-file-merge3.xml +++ b/reference/xdiff/functions/xdiff-file-merge3.xml @@ -1,5 +1,5 @@ - + @@ -27,6 +27,27 @@ Returns &true; if merge was successful, string with rejected chunks if it was not or &false; if an internal error happened. + + <function>xdiff_file_merge3</function> example + + The following code merges three files into one. + + + +]]> + + See also xdiff_string_merge3. diff --git a/reference/xdiff/functions/xdiff-file-patch-binary.xml b/reference/xdiff/functions/xdiff-file-patch-binary.xml index cf27e00588..676391804c 100644 --- a/reference/xdiff/functions/xdiff-file-patch-binary.xml +++ b/reference/xdiff/functions/xdiff-file-patch-binary.xml @@ -1,5 +1,5 @@ - + @@ -22,9 +22,36 @@ patch and stores result in file dest. + + + Both files (file and patch) will be loaded into memory so ensure that your memory_limit is set high enough. + + &return.success; + + <function>xdiff_file_patch_binary</function> example + + The following code applies binary diff to a file. + + + +]]> + + See also xdiff_string_patch_binary. diff --git a/reference/xdiff/functions/xdiff-file-patch.xml b/reference/xdiff/functions/xdiff-file-patch.xml index 1c31e38493..9a5d956165 100644 --- a/reference/xdiff/functions/xdiff-file-patch.xml +++ b/reference/xdiff/functions/xdiff-file-patch.xml @@ -1,5 +1,5 @@ - + @@ -32,6 +32,48 @@ Returns &false; if an internal error happened, string with rejected chunks of patch or &true; if patch has been successfully applied. + + <function>xdiff_file_patch</function> example + + The following code applies unified diff to a file. + + + +]]> + + + + Patch reversing example + + The following code reverses a patch. + + + +]]> + + See also xdiff_string_patch. diff --git a/reference/xdiff/functions/xdiff-string-diff.xml b/reference/xdiff/functions/xdiff-string-diff.xml index c69adb858c..2eae65efb1 100644 --- a/reference/xdiff/functions/xdiff-string-diff.xml +++ b/reference/xdiff/functions/xdiff-string-diff.xml @@ -1,5 +1,5 @@ - + @@ -24,9 +24,36 @@ want to include in diff result. Set minimal to &true; if you want to minimalize size of diff (can take a long time). + + + This function doesn't work well with binary strings. To make diff of binary + strings use xdiff_string_diff_binary. + + Returns string with result or &false; if an internal error happened. + + <function>xdiff_string_diff</function> example + + The following code makes unified diff of two articles. + + + +]]> + + See also xdiff_file_diff. diff --git a/reference/xdiff/functions/xdiff-string-patch.xml b/reference/xdiff/functions/xdiff-string-patch.xml index fc047629d3..eeea6225d2 100644 --- a/reference/xdiff/functions/xdiff-string-patch.xml +++ b/reference/xdiff/functions/xdiff-string-patch.xml @@ -1,5 +1,5 @@ - + @@ -31,6 +31,34 @@ If error is passed then rejected parts are stored inside this variable. + + <function>xdiff_string_patch</function> example + + The following code applies changes to some article. + + + +]]> + + Returns a patched string.