Class used internally by Diff to actually compute the diffs.

This class uses the Unix diff program via shell_exec to compute the differences between the two input arrays.

Copyright 2007-2010 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 Milian Wolff
package Text_Diff
since 0.3.0

 Methods

Get lines from either the old or new text

_getLines(array $text_lines, integer $line_no, integer $end = false) : array
access private

Parameters

$text_lines

array

Either $from_lines or $to_lines (passed by reference).

$line_no

integer

Current line number (passed by reference).

$end

integer

Optional end line, when we want to chop more than one line.

Returns

arrayThe chopped lines

Returns the array of differences.

diff(array $from_lines, array $to_lines) : array

Parameters

$from_lines

array

lines of text from old file

$to_lines

array

lines of text from new file

Returns

arrayall changes made (array with Text_Diff_Op_* objects)

 Properties

 

Path to the diff executable

$_diffCommand : string

Default

'diff'