MediaWiki  REL1_22
DiffFormatter Class Reference

A class to format Diffs. More...

Inheritance diagram for DiffFormatter:

List of all members.

Public Member Functions

 _added ($lines)
 _block ($xbeg, $xlen, $ybeg, $ylen, &$edits)
 _block_header ($xbeg, $xlen, $ybeg, $ylen)
 _changed ($orig, $closing)
 _context ($lines)
 _deleted ($lines)
 _end_block ()
 _end_diff ()
 _lines ($lines, $prefix= ' ')
 _start_block ($header)
 _start_diff ()
 format ($diff)
 Format a diff.

Public Attributes

 $leading_context_lines = 0
 Number of leading context "lines" to preserve.
 $trailing_context_lines = 0
 Number of trailing context "lines" to preserve.

Detailed Description

A class to format Diffs.

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

Todo:
document
Access:
private

Definition at line 865 of file DairikiDiff.php.


Member Function Documentation

DiffFormatter::_added ( lines)
Parameters:
$lines

Reimplemented in TableDiffFormatter, and UnifiedDiffFormatter.

Definition at line 1034 of file DairikiDiff.php.

References $lines, and _lines().

Referenced by _block(), and _changed().

DiffFormatter::_block ( xbeg,
xlen,
ybeg,
ylen,
&$  edits 
)
Parameters:
$xbeg
$xlen
$ybeg
$ylen
$edits

Definition at line 956 of file DairikiDiff.php.

References _added(), _block_header(), _changed(), _context(), _deleted(), _end_block(), _start_block(), as, wfProfileIn(), and wfProfileOut().

Referenced by format().

DiffFormatter::_block_header ( xbeg,
xlen,
ybeg,
ylen 
)
Parameters:
$xbeg
$xlen
$ybeg
$ylen
Returns:
string

Reimplemented in TableDiffFormatter, and UnifiedDiffFormatter.

Definition at line 996 of file DairikiDiff.php.

Referenced by _block().

DiffFormatter::_changed ( orig,
closing 
)
Parameters:
$orig
$closing

Reimplemented in TableDiffFormatter, and UnifiedDiffFormatter.

Definition at line 1049 of file DairikiDiff.php.

References _added(), and _deleted().

Referenced by _block().

Parameters:
$lines

Reimplemented in TableDiffFormatter.

Definition at line 1027 of file DairikiDiff.php.

References $lines, and _lines().

Referenced by _block().

Parameters:
$lines

Reimplemented in TableDiffFormatter, and UnifiedDiffFormatter.

Definition at line 1041 of file DairikiDiff.php.

References $lines, and _lines().

Referenced by _block(), and _changed().

Reimplemented in TableDiffFormatter.

Definition at line 1011 of file DairikiDiff.php.

Referenced by _block().

Returns:
string

Definition at line 983 of file DairikiDiff.php.

Referenced by format().

DiffFormatter::_lines ( lines,
prefix = ' ' 
)
Parameters:
$lines
$prefixstring

Definition at line 1018 of file DairikiDiff.php.

References $lines, and as.

Referenced by _added(), UnifiedDiffFormatter\_added(), _context(), _deleted(), and UnifiedDiffFormatter\_deleted().

Reimplemented in TableDiffFormatter.

Definition at line 1007 of file DairikiDiff.php.

Referenced by _block().

Definition at line 976 of file DairikiDiff.php.

Referenced by format().

DiffFormatter::format ( diff)

Format a diff.

Parameters:
$diffDiff A Diff object.
Returns:
string The formatted output.

Reimplemented in ArrayDiffFormatter.

Definition at line 888 of file DairikiDiff.php.

References _block(), _end_diff(), _start_diff(), array(), as, wfProfileIn(), and wfProfileOut().


Member Data Documentation

DiffFormatter::$leading_context_lines = 0

Number of leading context "lines" to preserve.

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

Reimplemented in UnifiedDiffFormatter.

Definition at line 872 of file DairikiDiff.php.

DiffFormatter::$trailing_context_lines = 0

Number of trailing context "lines" to preserve.

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

Reimplemented in UnifiedDiffFormatter.

Definition at line 880 of file DairikiDiff.php.


The documentation for this class was generated from the following file: