A class to render Diffs in different formats.

This class renders the diff in classic diff format. It is intended that this class be customized via inheritance, to obtain fancier outputs.

Copyright 2004-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.

package Text_Diff

 Methods

PHP4 constructor.

Text_Diff_Renderer($params = array()

Parameters

$params

Constructor.

__construct($params = array()

Parameters

$params

_added()

_added($lines) 

Parameters

$lines

_block()

_block($xbeg, $xlen, $ybeg, $ylen, $edits) 

Parameters

$xbeg

$xlen

$ybeg

$ylen

$edits

_blockHeader()

_blockHeader($xbeg, $xlen, $ybeg, $ylen) 

Parameters

$xbeg

$xlen

$ybeg

$ylen

_changed()

_changed($orig, $final) 

Parameters

$orig

$final

_context()

_context($lines) 

Parameters

$lines

_deleted()

_deleted($lines) 

Parameters

$lines

_endBlock()

_endBlock() 

_endDiff()

_endDiff() 

_lines()

_lines($lines, $prefix = ' '

Parameters

$lines

$prefix

_startBlock()

_startBlock($header) 

Parameters

$header

_startDiff()

_startDiff() 

Get any renderer parameters.

getParams() : array

Returns

arrayAll parameters of this renderer object.

Renders a diff.

render(\Text_Diff $diff) : string

Parameters

$diff

\Text_Diff

A Text_Diff object.

Returns

stringThe formatted output.

 Properties

 

Number of leading context "lines" to preserve.

$_leading_context_lines 

Default

0

This should be left at zero for this class, but subclasses may want to set this to other values.

 

Number of trailing context "lines" to preserve.

$_trailing_context_lines 

Default

0

This should be left at zero for this class, but subclasses may want to set this to other values.