Documentation

Horde_Text_Diff_Engine_Shell
in package

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-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
author

Milian Wolff mail@milianw.de

Table of Contents

$_diffCommand  : string
Path to the diff executable
diff()  : array<string|int, mixed>
Returns the array of differences.
_getLines()  : array<string|int, mixed>
Get lines from either the old or new text

Properties

$_diffCommand

Path to the diff executable

protected string $_diffCommand = 'diff'

Methods

diff()

Returns the array of differences.

public diff(array<string|int, mixed> $from_lines, array<string|int, mixed> $to_lines) : array<string|int, mixed>
Parameters
$from_lines : array<string|int, mixed>

lines of text from old file

$to_lines : array<string|int, mixed>

lines of text from new file

Return values
array<string|int, mixed>

all changes made (array with Horde_Text_Diff_Op_* objects)

_getLines()

Get lines from either the old or new text

protected _getLines(array<string|int, mixed> &$text_lines, int &$line_no[, int $end = false ]) : array<string|int, mixed>
Parameters
$text_lines : array<string|int, mixed>

Either $from_lines or $to_lines

$line_no : int

Current line number

$end : int = false

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

Tags
access

private

Return values
array<string|int, mixed>

The chopped lines

Search results