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

Class: Text_Diff_Engine_string

Source Location: /Text_Diff-1.1.1/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.7 2009/07/24 13:04:43 jan Exp $

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

  • Author: Örjan Persson <o@42mm.org>
  • Since: 0.2.0


[ 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 148]

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 93]

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 Fri, 24 Jul 2009 15:00:05 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.