Public Member Functions | |
diff ($from_lines, $to_lines) | |
diff_local ($from_lines, $to_lines) | |
_line_hash ($line) | |
Returns the whole line if it's small enough, or the MD5 hash otherwise. | |
_diag ($xoff, $xlim, $yoff, $ylim, $nchunks) | |
_lcs_pos ($ypos) | |
_compareseq ($xoff, $xlim, $yoff, $ylim) | |
_shift_boundaries ($lines, &$changed, $other_changed) | |
Public Attributes | |
const | MAX_XREF_LENGTH = 10000 |
The algorithm used here is mostly lifted from the perl module Algorithm::Diff (version 1.06) by Ned Konz, which is available at: http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html
Some ideas are (and a bit of code) are from from analyze.c, from GNU diffutils-2.7, which can be found at: ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
closingly, some ideas (subdivision by NCHUNKS > 2, and some optimizations) are my own.
Line length limits for robustness added by Tim Starling, 2005-08-31 Alternative implementation added by Guy Van den Broeck, 2008-07-30
Definition at line 1068 of file DifferenceEngine.php.
_DiffEngine::_compareseq | ( | $ | xoff, | |
$ | xlim, | |||
$ | yoff, | |||
$ | ylim | |||
) |
Definition at line 1321 of file DifferenceEngine.php.
References _diag().
Referenced by diff_local().
_DiffEngine::_diag | ( | $ | xoff, | |
$ | xlim, | |||
$ | yoff, | |||
$ | ylim, | |||
$ | nchunks | |||
) |
Definition at line 1212 of file DifferenceEngine.php.
References $i, $n, and _lcs_pos().
Referenced by _compareseq().
_DiffEngine::_lcs_pos | ( | $ | ypos | ) |
_DiffEngine::_line_hash | ( | $ | line | ) |
Returns the whole line if it's small enough, or the MD5 hash otherwise.
Definition at line 1188 of file DifferenceEngine.php.
Referenced by diff_local().
_DiffEngine::_shift_boundaries | ( | $ | lines, | |
&$ | changed, | |||
$ | other_changed | |||
) |
Definition at line 1377 of file DifferenceEngine.php.
References $changed, $i, $start, wfProfileIn(), and wfProfileOut().
Referenced by diff().
_DiffEngine::diff | ( | $ | from_lines, | |
$ | to_lines | |||
) |
Definition at line 1072 of file DifferenceEngine.php.
References $delete, _shift_boundaries(), diff_local(), wfProfileIn(), and wfProfileOut().
_DiffEngine::diff_local | ( | $ | from_lines, | |
$ | to_lines | |||
) |
Definition at line 1122 of file DifferenceEngine.php.
References $wgExternalDiffEngine, _compareseq(), _line_hash(), wfProfileIn(), and wfProfileOut().
Referenced by diff().
const _DiffEngine::MAX_XREF_LENGTH = 10000 |
Definition at line 1070 of file DifferenceEngine.php.