PHP 클래스 Diff

상속: extends CI_Model
파일 보기 프로젝트 열기: kylekatarnls/jade-php 1 사용 예제들

공개 메소드들

메소드 설명
compare ( $string1, $string2, $compareCharacters = false, $ignoreIndent = true ) * Returns the diff for two strings. The return value is an array, each of whose values is an array containing two values: a line (or character, if $compareCharacters is true), and one of the constants DIFF::UNMODIFIED (the line or character is in both strings), DIFF::DELETED (the line or character is only in the first string), and DIFF::INSERTED (the line or character is only in the second string). The parameters are:
compareFiles ( $file1, $file2, $compareCharacters = false ) * Returns the diff for two files. The parameters are:
toHTML ( $diff, $separator = '<br>' ) * Returns a diff as an HTML string, where unmodified lines are contained within 'span' elements, deletions are contained within 'del' elements, and insertions are contained within 'ins' elements. The parameters are:
toString ( $diff, $separator = " " ) * Returns a diff as a string, where unmodified lines are prefixed by ' ', deletions are prefixed by '- ', and insertions are prefixed by '+ '. The parameters are:
toTable ( $diff, $indentation = '', $separator = '<br>' ) * Returns a diff as an HTML table. The parameters are:

보호된 메소드들

메소드 설명
compareLine ( $line1, $line2, $ignoreIndent = true )
ignoreIndent ( $line )

비공개 메소드들

메소드 설명
computeTable ( $sequence1, $sequence2, $start, $end1, $end2, $ignoreIndent = true ) * Returns the table of longest common subsequence lengths for the specified sequences. The parameters are:
generatePartialDiff ( $table, $sequence1, $sequence2, $start, $ignoreIndent = true ) * Returns the partial diff for the specificed sequences, in reverse order.
getCellContent ( $diff, $indentation, $separator, &$index, $type ) * Returns the content of the cell, for use in the toTable function. The parameters are:

메소드 상세

compare() 공개 정적인 메소드

$string1 - the first string $string2 - the second string $compareCharacters - true to compare characters, and false to compare lines; this optional parameter defaults to false $ignoreIndent - false to compare also white spaces in the beginning on the line, true to ignore them
public static compare ( $string1, $string2, $compareCharacters = false, $ignoreIndent = true )

compareFiles() 공개 정적인 메소드

$file1 - the path to the first file $file2 - the path to the second file $compareCharacters - true to compare characters, and false to compare lines; this optional parameter defaults to false
public static compareFiles ( $file1, $file2, $compareCharacters = false )

compareLine() 보호된 정적인 메소드

protected static compareLine ( $line1, $line2, $ignoreIndent = true )

ignoreIndent() 보호된 정적인 메소드

protected static ignoreIndent ( $line )

toHTML() 공개 정적인 메소드

$diff - the diff array $separator - the separator between lines; this optional parameter defaults to '
'
public static toHTML ( $diff, $separator = '<br>' )

toString() 공개 정적인 메소드

$diff - the diff array $separator - the separator between lines; this optional parameter defaults to "\n"
public static toString ( $diff, $separator = " " )

toTable() 공개 정적인 메소드

$diff - the diff array $indentation - indentation to add to every line of the generated HTML; this optional parameter defaults to '' $separator - the separator between lines; this optional parameter defaults to '
'
public static toTable ( $diff, $indentation = '', $separator = '<br>' )