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 Group 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 56
public diff_renderer($params = array())

Constructor.

Parameters

$params

at line 73
public array get_params()

Get any renderer parameters.

Return Value

array All parameters of this renderer object.

at line 94
public string render(diff $diff)

Renders a diff.

Parameters

diff $diff A diff object.

Return Value

string The formatted output.

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

Parameters

$xbeg
$xlen
$ybeg
$ylen
$edits

at line 210
public _start_diff()

at line 215
public _end_diff()

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

Parameters

$xbeg
$xlen
$ybeg
$ylen

at line 245
public _start_block($header)

Parameters

$header

at line 250
public _end_block()

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

Parameters

$lines
$prefix

at line 260
public _context($lines)

Parameters

$lines

at line 265
public _added($lines)

Parameters

$lines

at line 270
public _deleted($lines)

Parameters

$lines

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

Parameters

$orig
$final

at line 283
public get_diff_content($diff)

Our function to get the diff

Parameters

$diff