[ Index ]

WordPress Cross Reference

title

Body

[close]

/wp-includes/ -> wp-diff.php (summary)

WordPress Diff bastard child of old MediaWiki Diff Formatter. Basically all that remains is the table structure and some method names.

File Size: 458 lines (12 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

WP_Text_Diff_Renderer_Table:: (14 methods):
  __construct()
  _startBlock()
  _lines()
  addedLine()
  deletedLine()
  contextLine()
  emptyLine()
  _added()
  _deleted()
  _context()
  _changed()
  interleave_changed_lines()
  compute_string_distance()
  difference()

WP_Text_Diff_Renderer_inline:: (1 method):
  _splitOnWords()


Class: WP_Text_Diff_Renderer_Table  - X-Ref

Table renderer to display the diff lines.

__construct( $params = array()   X-Ref
Constructor - Call parent constructor with params array.

This will set class properties based on the key value pairs in the array.

param: array $params

_startBlock( $header )   X-Ref

param: string $header
return: string

_lines( $lines, $prefix=' ' )   X-Ref

param: array $lines
param: string $prefix

addedLine( $line )   X-Ref

param: string $line HTML-escape the value.
return: string

deletedLine( $line )   X-Ref

param: string $line HTML-escape the value.
return: string

contextLine( $line )   X-Ref

param: string $line HTML-escape the value.
return: string

emptyLine()   X-Ref

return: string

_added( $lines, $encode = true )   X-Ref

param: array $lines
param: bool $encode
return: string

_deleted( $lines, $encode = true )   X-Ref

param: array $lines
param: bool $encode
return: string

_context( $lines, $encode = true )   X-Ref

param: array $lines
param: bool $encode
return: string

_changed( $orig, $final )   X-Ref
Process changed lines to do word-by-word diffs for extra highlighting.

(TRAC style) sometimes these lines can actually be deleted or added rows.
We do additional processing to figure that out

param: array $orig
param: array $final
return: string

interleave_changed_lines( $orig, $final )   X-Ref
Takes changed blocks and matches which rows in orig turned into which rows in final.

Returns
*_matches ( which rows match with which )
*_rows ( order of rows in each column interleaved with blank rows as
necessary )

param: unknown_type $orig
param: unknown_type $final
return: unknown

compute_string_distance( $string1, $string2 )   X-Ref
Computes a number that is intended to reflect the "distance" between two strings.

param: string $string1
param: string $string2
return: int

difference( $a, $b )   X-Ref

param: int $a
param: int $b
return: int

Class: WP_Text_Diff_Renderer_inline  - X-Ref

Better word splitting than the PEAR package provides.

_splitOnWords($string, $newlineEscape = "\n")   X-Ref

param: string $string
param: string $newlineEscape
return: string



Generated: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu