xdiff_file_merge3 함수

(PECL xdiff >= 0.2.0)

xdiff_file_merge3 — 3개의 파일을 하나로 합치기


설명

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

세 개의 파일을 하나로 병합하고 결과를 파일 dest에 저장합니다. old_file은 원본 버전이고 new_file1new_file2는 원본의 수정된 버전입니다.


매개변수

old_file
첫 번째 파일의 경로입니다. "이전" 파일 역할을 합니다.
new_file1
두 번째 파일의 경로입니다. old_file의 수정된 버전으로 작동합니다.
new_file2
세 번째 파일의 경로입니다. old_file의 수정된 버전으로 작동합니다.
dest
new_file1new_file2 모두에서 병합된 변경 사항을 포함하는 결과 파일의 경로입니다.

반환 값

병합에 성공하면 true를 반환하고 그렇지 않으면 거부된 청크가 있는 문자열을 반환하고 내부 오류가 발생하면 false를 반환합니다.


Examples

예제 #1 xdiff_file_merge3() 예제

다음 코드는 세 개의 파일을 하나로 병합합니다.

                  
<?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;
}
?>
                  
                

기타