_DiffEngine Class Reference
[DifferenceEngine]

Class used internally by Diff to actually compute the diffs. More...

List of all members.

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


Detailed Description

Class used internally by Diff to actually compute the diffs.

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

Author:
Geoffrey T. Dairiki, Tim Starling, Guy Van den Broeck
Access:
private

Definition at line 1068 of file DifferenceEngine.php.


Member Function Documentation

_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  ) 

Definition at line 1285 of file DifferenceEngine.php.

References $end.

Referenced by _diag().

_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 
)

_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().


Member Data Documentation

Definition at line 1070 of file DifferenceEngine.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:29 2009 for MediaWiki by  doxygen 1.5.9