equal
deleted
inserted
replaced
4 * |
4 * |
5 * This class is implemented using native PHP code. |
5 * This class is implemented using native PHP code. |
6 * |
6 * |
7 * The algorithm used here is mostly lifted from the perl module |
7 * The algorithm used here is mostly lifted from the perl module |
8 * Algorithm::Diff (version 1.06) by Ned Konz, which is available at: |
8 * Algorithm::Diff (version 1.06) by Ned Konz, which is available at: |
9 * http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip |
9 * https://cpan.metacpan.org/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip |
10 * |
10 * |
11 * More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html |
11 * More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html |
12 * |
12 * |
13 * Some ideas (and a bit of code) are taken from analyze.c, of GNU |
13 * Some ideas (and a bit of code) are taken from analyze.c, of GNU |
14 * diffutils-2.7, which can be found at: |
14 * diffutils-2.7, which can be found at: |
19 * code was written by him, and is used/adapted with his permission. |
19 * code was written by him, and is used/adapted with his permission. |
20 * |
20 * |
21 * Copyright 2004-2010 The Horde Project (http://www.horde.org/) |
21 * Copyright 2004-2010 The Horde Project (http://www.horde.org/) |
22 * |
22 * |
23 * See the enclosed file COPYING for license information (LGPL). If you did |
23 * See the enclosed file COPYING for license information (LGPL). If you did |
24 * not receive this file, see http://opensource.org/licenses/lgpl-license.php. |
24 * not receive this file, see https://opensource.org/license/lgpl-2-1/. |
25 * |
25 * |
26 * @author Geoffrey T. Dairiki <dairiki@dairiki.org> |
26 * @author Geoffrey T. Dairiki <dairiki@dairiki.org> |
27 * @package Text_Diff |
27 * @package Text_Diff |
28 */ |
28 */ |
29 class Text_Diff_Engine_native { |
29 class Text_Diff_Engine_native { |
|
30 |
|
31 public $xchanged; |
|
32 public $ychanged; |
|
33 public $xv; |
|
34 public $yv; |
|
35 public $xind; |
|
36 public $yind; |
|
37 public $seq; |
|
38 public $in_seq; |
|
39 public $lcs; |
30 |
40 |
31 function diff($from_lines, $to_lines) |
41 function diff($from_lines, $to_lines) |
32 { |
42 { |
33 array_walk($from_lines, array('Text_Diff', 'trimNewlines')); |
43 array_walk($from_lines, array('Text_Diff', 'trimNewlines')); |
34 array_walk($to_lines, array('Text_Diff', 'trimNewlines')); |
44 array_walk($to_lines, array('Text_Diff', 'trimNewlines')); |