Class Horde_Text_Diff_Engine_String
Parses unified or context diffs output from eg. the diff utility.
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 o@42mm.org
Copyright 2005-2012 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.
Methods summary
public
array
|
#
diff( string $diff, string $mode = 'autodetect' )
Parses a unified or context diff.
Parses a unified or context 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.
Parameters
- $diff
- The diff content.
- $mode
- <p>The diff mode of the content in $diff. One of
'context', 'unified', or 'autodetect'.</p>
Returns
array List of all diff operations.
Throws
|
public
array
|
#
parseUnifiedDiff( array $diff )
Parses an array containing the unified diff.
Parses an array containing the unified diff.
Parameters
Returns
array List of all diff operations.
|
public
array
|
#
parseContextDiff( array & $diff )
Parses an array containing the context diff.
Parses an array containing the context diff.
Parameters
Returns
array List of all diff operations.
|