Text_Diff
[ class tree: Text_Diff ] [ index: Text_Diff ] [ all elements ]

Class: Text_Diff_Engine_string

Source Location: /Text_Diff-1.1.0/Diff/Engine/string.php

Class Overview


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


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 25]
Parses unified or context diffs output from eg. the diff utility.

Example:

  1.  $patch file_get_contents('example.patch');
  2.  $diff = new Text_Diff('string'array($patch));
  3.  $renderer = new Text_Diff_Renderer_inline();
  4.  echo $renderer->render($diff);

$Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.5.2.5 2008/09/10 08:31:58 jan Exp $

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://opensource.org/licenses/lgpl-license.php.



[ Top ]


Method Detail

diff   [line 40]

array diff( string $diff, [string $mode = 'autodetect'])

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: List of all diff operations.

Parameters:

string   $diff   —  The diff content.
string   $mode   —  The diff mode of the content in $diff. One of 'context', 'unified', or 'autodetect'.

[ Top ]

parseContextDiff   [line 135]

array parseContextDiff( &$diff, array $diff)

Parses an array containing the context diff.
  • Return: List of all diff operations.

Parameters:

array   $diff   —  Array of lines.
   &$diff   — 

[ Top ]

parseUnifiedDiff   [line 80]

array parseUnifiedDiff( array $diff)

Parses an array containing the unified diff.
  • Return: List of all diff operations.

Parameters:

array   $diff   —  Array of lines.

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:50:46 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.