phpBB API Documentation
Class

diff_renderer

class diff_renderer

Code from pear.php.net, TextDiff-1.1.0 package http://pear.php.net/package/TextDiff/

Modified by phpBB Limited to meet our coding standards and being able to integrate into phpBB

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-2008 The Horde Project (http://www.horde.org/)

Properties

$_leading_context_lines Number of leading context "lines" to preserve.
$_trailing_context_lines Number of trailing context "lines" to preserve.

Methods

diff_renderer($params = array())

Constructor.

array get_params()

Get any renderer parameters.

string render(diff $diff)

Renders a diff.

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

_start_diff()

_end_diff()

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

_start_block($header)

_end_block()

_lines($lines, $prefix = ' ')

_context($lines)

_added($lines)

_deleted($lines)

_changed($orig, $final)

get_diff_content($diff)

Our function to get the diff

Details

at line 59
public diff_renderer($params = array())

Constructor.

Parameters

$params

at line 76
public array get_params()

Get any renderer parameters.

Return Value

array All parameters of this renderer object.

at line 97
public string render(diff $diff)

Renders a diff.

Parameters

diff $diff A diff object.

Return Value

string The formatted output.

at line 184
public _block($xbeg, $xlen, $ybeg, $ylen, $edits)

Parameters

$xbeg
$xlen
$ybeg
$ylen
$edits

at line 213
public _start_diff()

at line 218
public _end_diff()

at line 223
public _block_header($xbeg, $xlen, $ybeg, $ylen)

Parameters

$xbeg
$xlen
$ybeg
$ylen

at line 248
public _start_block($header)

Parameters

$header

at line 253
public _end_block()

at line 258
public _lines($lines, $prefix = ' ')

Parameters

$lines
$prefix

at line 263
public _context($lines)

Parameters

$lines

at line 268
public _added($lines)

Parameters

$lines

at line 273
public _deleted($lines)

Parameters

$lines

at line 278
public _changed($orig, $final)

Parameters

$orig
$final

at line 286
public get_diff_content($diff)

Our function to get the diff

Parameters

$diff