class _DiffEngine

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

@author Geoffrey T. Dairiki, Tim Starling @private @subpackage DifferenceEngine

Hierarchy

Expanded class hierarchy of _DiffEngine

File

drupal/core/lib/Drupal/Component/Diff/DiffEngine.php, line 135
A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)

View source

Members

Namesort descending Modifiers Type Description Overrides
_DiffEngine::diff function
_DiffEngine::MAX_XREF_LENGTH function
_DiffEngine::_compareseq function Find LCS of two sequences.
_DiffEngine::_diag function Divide the Largest Common Subsequence (LCS) of the sequences [XOFF, XLIM) and [YOFF, YLIM) into NCHUNKS approximately equally sized segments.
_DiffEngine::_lcs_pos function
_DiffEngine::_line_hash function Returns the whole line if it's small enough, or the MD5 hash otherwise.
_DiffEngine::_shift_boundaries function Adjust inserts/deletes of identical lines to join changes as much as possible.