equal
deleted
inserted
replaced
3 * Class used internally by Diff to actually compute the diffs. |
3 * Class used internally by Diff to actually compute the diffs. |
4 * |
4 * |
5 * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff) |
5 * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff) |
6 * to compute the differences between the two input arrays. |
6 * to compute the differences between the two input arrays. |
7 * |
7 * |
8 * $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.6 2008/01/04 10:07:50 jan Exp $ |
8 * Copyright 2004-2010 The Horde Project (http://www.horde.org/) |
9 * |
|
10 * Copyright 2004-2008 The Horde Project (http://www.horde.org/) |
|
11 * |
9 * |
12 * See the enclosed file COPYING for license information (LGPL). If you did |
10 * See the enclosed file COPYING for license information (LGPL). If you did |
13 * not receive this file, see http://opensource.org/licenses/lgpl-license.php. |
11 * not receive this file, see http://opensource.org/licenses/lgpl-license.php. |
14 * |
12 * |
15 * @author Jon Parise <jon@horde.org> |
13 * @author Jon Parise <jon@horde.org> |
40 * lines using this approach, so we can't add Text_Diff_Op_changed |
38 * lines using this approach, so we can't add Text_Diff_Op_changed |
41 * instances to the $edits array. The result is still perfectly |
39 * instances to the $edits array. The result is still perfectly |
42 * valid, albeit a little less descriptive and efficient. */ |
40 * valid, albeit a little less descriptive and efficient. */ |
43 $edits = array(); |
41 $edits = array(); |
44 foreach ($diff as $line) { |
42 foreach ($diff as $line) { |
|
43 if (!strlen($line)) { |
|
44 continue; |
|
45 } |
45 switch ($line[0]) { |
46 switch ($line[0]) { |
46 case ' ': |
47 case ' ': |
47 $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1))); |
48 $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1))); |
48 break; |
49 break; |
49 |
50 |