• PHP Video Tutorials

PHP - xdiff file_rabdiff() Function



xdiff_file_rabdiff() function can make a binary diff of two files by using Rabin's polynomial fingerprinting algorithm.

Syntax

bool xdiff_file_rabdiff( string $old_file , string $new_file , string $dest )

xdiff_file_rabdiff() function can make a binary diff of two files and store the result in a patch file. The difference between xdiff_file_rabdiff() and xdiff_file_bdiff() is different algorithm used that result in faster execution and smaller diff produced. This function can work with text and binary files. The resulting patch file can be later applied by using xdiff_file_bpatch()/xdiff_string_bpatch().

xdiff_file_rabdiff() function can return true on success or false on failure.

Example

<?php
   $old_version = "my_script_1.0.tgz";
   $new_version = "my_script_1.1.tgz";

   xdiff_file_rabdiff($old_version, $new_version, "my_script.bdiff");
?>
php_function_reference.htm
Advertisements