PHP - xdiff file_bpatch() Function
xdiff_file_bpatch() function can patch a file with a binary diff.
Syntax
bool xdiff_file_bpatch( string $file , string $patch , string $dest )
xdiff_file_bpatch() function can patch a file with binary patch and store the result in a file dest. This function can accept patches created both via xdiff_file_bdiff() and xdiff_file_rabdiff() functions or their string counterparts.
xdiff_file_bpatch() function can return true on success or false on failure.
Example
<?php
$old_version = "archive-1.0.tgz";
$patch = "archive.bpatch";
$result = xdiff_file_bpatch($old_version, $patch, "archive-1.1.tgz");
if($result) {
echo "File patched";
} else {
echo "File couldn't be patched";
}
?>
php_function_reference.htm
Advertisements