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])
파일 보기 프로젝트 열기: horde/horde

공개 메소드들

메소드 설명
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.