CakeFest 2024: The Official CakePHP Conference

xdiff_file_merge3

(PECL xdiff >= 0.2.0)

xdiff_file_merge33 つのファイルをひとつに統合する

説明

xdiff_file_merge3(
    string $old_file,
    string $new_file1,
    string $new_file2,
    string $dest
): mixed

3 つのファイルをひとつに統合し、結果をファイル dest に保存します。 old_file が元のバージョンで、new_file1new_file2 が修正したバージョンとなります。

パラメータ

old_file

最初のファイルへのパス。"旧" ファイルです。

new_file1

2 番目のファイルへのパス。old_file の修正版です。

new_file2

3 番目のファイルへのパス。old_file の修正版です。

dest

結果のファイルへのパス。new_file1new_file2 の両方の変更点をマージした結果が保存されます。

戻り値

成功した場合に true 、もし拒否された部分がある場合にはその文字列、 内部エラーが発生した場合に false を返します。

例1 xdiff_file_merge3() の例

以下のコードは、3 つのファイルをひとつに統合します。

<?php
$old_version
= 'original_script.php';
$fix1 = 'script_with_fix1.php';
$fix2 = 'script_with_fix2.php';

$errors = xdiff_file_merge3($old_version, $fix1, $fix2, 'fixed_script.php');
if (
is_string($errors)) {
echo
"Rejects:\n";
echo
$errors;
}
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top