PHP Класс Horde_Text_Diff_Engine_String, horde

Example: $patch = file_get_contents('example.patch'); $diff = new Horde_Text_Diff('string', array($patch)); $renderer = new Horde_Text_Diff_Renderer_inline(); echo $renderer->render($diff); Copyright 2005 Örjan Persson Copyright 2005-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Örjan Persson ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
diff ( string $diff, string $mode = 'autodetect' ) : array Parses a unified or context diff.
parseContextDiff ( array &$diff ) : array Parses an array containing the context diff.
parseUnifiedDiff ( array $diff ) : array Parses an array containing the unified diff.

Описание методов

diff() публичный Метод

First param contains the whole diff and the second can be used to force a specific diff type. If the second parameter is 'autodetect', the diff will be examined to find out which type of diff this is.
public diff ( string $diff, string $mode = 'autodetect' ) : array
$diff string The diff content.
$mode string The diff mode of the content in $diff. One of 'context', 'unified', or 'autodetect'.
Результат array List of all diff operations.

parseContextDiff() публичный Метод

Parses an array containing the context diff.
public parseContextDiff ( array &$diff ) : array
$diff array Array of lines.
Результат array List of all diff operations.

parseUnifiedDiff() публичный Метод

Parses an array containing the unified diff.
public parseUnifiedDiff ( array $diff ) : array
$diff array Array of lines.
Результат array List of all diff operations.