\Text_Diff_Engine_native
Class used internally by Text_Diff to actually compute the diffs.
This class is implemented using native PHP code.
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 (and a bit of code) are taken from analyze.c, of GNU
diffutils-2.7, which can be found at:
ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from
Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
code was written by him, and is used/adapted with his permission.
$Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.7.2.5 2009/01/06 15:23:41 jan Exp $
Copyright 2004-2009 The Horde Project (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you did
not receive this file, see http://opensource.org/licenses/lgpl-license.php.
- Author: Geoffrey T. Dairiki <dairiki@dairiki.org>
Synopsis
- // methods
- public void diff()
- public void _diag()
- public void _lcsPos()
- public void _compareseq()
- public void _shiftBoundaries()
Methods
public
- _compareseq() — Finds LCS of two sequences.
- _diag() — Divides the Largest Common Subsequence (LCS) of the sequences (XOFF, XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized segments.
- _lcsPos()
- _shiftBoundaries() — Adjusts inserts/deletes of identical lines to join changes as much as possible.
- diff()