[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/Text/Diff/Engine/ -> string.php (summary)

(no description)

File Size: 248 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Text_Diff_Engine_string:: (3 methods):
  diff()
  parseUnifiedDiff()
  parseContextDiff()


Class: Text_Diff_Engine_string  - X-Ref

Parses unified or context diffs output from eg. the diff utility.

Example:
<code>
$patch = file_get_contents('example.patch');
$diff = new Text_Diff('string', array($patch));
$renderer = new Text_Diff_Renderer_inline();
echo $renderer->render($diff);
</code>

Copyright 2005 Örjan Persson <o@42mm.org>
Copyright 2005-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.

diff($diff, $mode = 'autodetect')   X-Ref
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.

return: array  List of all diff operations.
param: string $diff  The diff content.
param: string $mode  The diff mode of the content in $diff. One of

parseUnifiedDiff($diff)   X-Ref
Parses an array containing the unified diff.

return: array  List of all diff operations.
param: array $diff  Array of lines.

parseContextDiff(&$diff)   X-Ref
Parses an array containing the context diff.

return: array  List of all diff operations.
param: array $diff  Array of lines.



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1