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 @private

Hierarchy

Expanded class hierarchy of DiffEngine

Related topics

File

core/includes/diff.inc, line 166
A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
DiffEngine::$lcs protected property
DiffEngine::$seq protected property
DiffEngine::$xchanged protected property
DiffEngine::$xind protected property
DiffEngine::$xv protected property
DiffEngine::compareSeq private function Find LCS of two sequences.
DiffEngine::diag private function Divide the Largest Common Subsequence (LCS) of the sequences [XOFF, XLIM) and [YOFF, YLIM) into NCHUNKS approximately equally sized segments.
DiffEngine::diff function
DiffEngine::diffLocal private function
DiffEngine::lcsPos private function
DiffEngine::lineHash private function Returns the whole line if it's small enough, or the MD5 hash otherwise
DiffEngine::MAX_XREF_LENGTH constant
DiffEngine::shiftBoundaries private function Adjust inserts/deletes of identical lines to join changes as much as possible.