MediaWiki  REL1_20
DifferenceEngine Class Reference
Inheritance diagram for DifferenceEngine:
Collaboration diagram for DifferenceEngine:

List of all members.

Public Member Functions

 __construct ($context=null, $old=0, $new=0, $rcid=0, $refreshCache=false, $unhide=false)
 #@-
 addHeader ($diff, $otitle, $ntitle, $multi= '', $notice= '')
 Add the header to a diff body.
 deletedIdMarker ($id)
 Build a wikitext link toward a deleted revision, if viewable.
 deletedLink ($id)
 Look up a special:Undelete link to the given deleted revision id, as a workaround for being unable to load deleted diffs in currently.
 generateDiffBody ($otext, $ntext)
 Generate a diff, no caching.
 getDiff ($otitle, $ntitle, $notice= '')
 Get complete diff table, including header.
 getDiffBody ()
 Get the diff table body, without header.
 getDiffLang ()
 getMultiNotice ()
 If there are revisions between the ones being compared, return a note saying so.
 getNewid ()
 getOldid ()
 loadNewText ()
 Load the text of the new revision, not the old one.
 loadRevisionData ()
 Load revision metadata for the specified articles.
 loadText ()
 Load the text of the revisions, as well as revision data.
 localiseLineNumbers ($text)
 Replace line numbers with the text in the user's language.
 localiseLineNumbersCb ($matches)
 renderNewRevision ()
 Show the new revision of the page.
 setReducedLineNumbers ($value=true)
 setText ($oldText, $newText)
 Use specified text instead of loading from the database.
 setTextLanguage ($lang)
 Set the language in which the diff text is written (Defaults to page content language).
 showDiff ($otitle, $ntitle, $notice= '')
 Get the diff text, send it to the OutputPage object Returns false if the diff could not be generated, otherwise returns true.
 showDiffPage ($diffOnly=false)
 showDiffStyle ()
 Add style sheets and supporting JS for diff display.
 wasCacheHit ()

Static Public Member Functions

static intermediateEditsMsg ($numEdits, $numUsers, $limit)
 Get a notice about how many intermediate edits and users there are.

Public Attributes

 $enableDebugComment = false
 Set this to true to add debug info to the HTML output.
 $mCacheHit = false
 $mNewid
Title $mNewPage
Revision $mNewRev
 $mNewtext
 $mOldid
 #@+
Title $mOldPage
Revision $mOldRev
 $mOldtext
 $mRcidMarkPatrolled
 $mRevisionsLoaded = false
 $mTextLoaded = 0

Protected Member Functions

 debug ($generator="internal")
 Generate a debug comment indicating diff generating time, server node, and generator backend.
 markPatrolledLink ()
 Get a link to mark the change as patrolled, or '' if there's either no revision to patrol or the user is not allowed to to it.
 revisionDeleteLink ($rev)

Protected Attributes

 $mDiffLang
 $mMarkPatrolledLink = null
 $mReducedLineNumbers = false
 $unhide = false

Private Member Functions

 getRevisionHeader (Revision $rev, $complete= '')
 Get a header for a specified revision.
 initDiffEngines ()
 Make sure the proper modules are loaded before we try to make the diff.
 loadRevisionIds ()
 Load revision IDs.
 showMissingRevision ()

Private Attributes

 $mRevisionsIdsLoaded = false

Detailed Description

Todo:
document

Definition at line 36 of file DifferenceEngine.php.


Constructor & Destructor Documentation

DifferenceEngine::__construct ( context = null,
old = 0,
new = 0,
rcid = 0,
refreshCache = false,
unhide = false 
)

#@-

Constructor

Parameters:
$contextIContextSource context to use, anything else will be ignored
$oldInteger old ID we want to show and diff with.
$newString either 'prev' or 'next'.
$rcidInteger ??? FIXME (default 0)
$refreshCacheboolean If set, refreshes the diff cache
$unhideboolean If set, allow viewing deleted revs

Definition at line 83 of file DifferenceEngine.php.


Member Function Documentation

DifferenceEngine::addHeader ( diff,
otitle,
ntitle,
multi = '',
notice = '' 
)

Add the header to a diff body.

Returns:
string

Definition at line 908 of file DifferenceEngine.php.

DifferenceEngine::debug ( generator = "internal") [protected]

Generate a debug comment indicating diff generating time, server node, and generator backend.

Returns:
string

Definition at line 773 of file DifferenceEngine.php.

Build a wikitext link toward a deleted revision, if viewable.

Parameters:
int$idrevision ID
Returns:
string wikitext fragment

Definition at line 171 of file DifferenceEngine.php.

Look up a special:Undelete link to the given deleted revision id, as a workaround for being unable to load deleted diffs in currently.

Parameters:
int$idrevision ID
Returns:
mixed URL or false

Definition at line 147 of file DifferenceEngine.php.

DifferenceEngine::generateDiffBody ( otext,
ntext 
)

Generate a diff, no caching.

Parameters:
$otextString: old text, must be already segmented
$ntextString: new text, must be already segmented
Returns:
bool|string

Definition at line 697 of file DifferenceEngine.php.

DifferenceEngine::getDiff ( otitle,
ntitle,
notice = '' 
)

Get complete diff table, including header.

Parameters:
$otitleTitle: old title
$ntitleTitle: new title
$noticeString: HTML between diff header and body
Returns:
mixed

Definition at line 590 of file DifferenceEngine.php.

Get the diff table body, without header.

Returns:
mixed (string/false)

Definition at line 605 of file DifferenceEngine.php.

Returns:
Language

Definition at line 109 of file DifferenceEngine.php.

If there are revisions between the ones being compared, return a note saying so.

Returns:
string

Definition at line 810 of file DifferenceEngine.php.

Returns:
Bool|int

Definition at line 135 of file DifferenceEngine.php.

Referenced by ApiQueryRevisions\extractRowInfo().

Returns:
int

Definition at line 127 of file DifferenceEngine.php.

Referenced by ApiQueryRevisions\extractRowInfo().

DifferenceEngine::getRevisionHeader ( Revision rev,
complete = '' 
) [private]

Get a header for a specified revision.

Parameters:
$revRevision
$completeString: 'complete' to get the header wrapped depending the visibility of the revision and a link to edit the page.
Returns:
String HTML fragment

Definition at line 860 of file DifferenceEngine.php.

Make sure the proper modules are loaded before we try to make the diff.

Definition at line 676 of file DifferenceEngine.php.

static DifferenceEngine::intermediateEditsMsg ( numEdits,
numUsers,
limit 
) [static]

Get a notice about how many intermediate edits and users there are.

Parameters:
$numEditsint
$numUsersint
$limitint
Returns:
string

Definition at line 842 of file DifferenceEngine.php.

Load the text of the new revision, not the old one.

Returns:
bool

Definition at line 1102 of file DifferenceEngine.php.

Load revision metadata for the specified articles.

If newid is 0, then compare the old article in oldid to the current article; if oldid is 0, then compare the current article to the immediately previous one (ignoring the value of newid).

If oldid is false, leave the corresponding revision object set to false. This is impossible via ordinary user input, and is provided for API convenience.

Returns:
bool

Definition at line 1016 of file DifferenceEngine.php.

Load revision IDs.

Definition at line 972 of file DifferenceEngine.php.

Load the text of the revisions, as well as revision data.

Returns:
bool

Definition at line 1071 of file DifferenceEngine.php.

Replace line numbers with the text in the user's language.

Returns:
mixed

Definition at line 795 of file DifferenceEngine.php.

Definition at line 800 of file DifferenceEngine.php.

Get a link to mark the change as patrolled, or '' if there's either no revision to patrol or the user is not allowed to to it.

Side effect: this method will call OutputPage::preventClickjacking() when a link is builded.

Returns:
String

Definition at line 423 of file DifferenceEngine.php.

Show the new revision of the page.

Definition at line 497 of file DifferenceEngine.php.

DifferenceEngine::revisionDeleteLink ( rev) [protected]
Parameters:
$revRevision
Returns:
String

Definition at line 486 of file DifferenceEngine.php.

Parameters:
$valuebool

Definition at line 102 of file DifferenceEngine.php.

DifferenceEngine::setText ( oldText,
newText 
)

Use specified text instead of loading from the database.

Definition at line 953 of file DifferenceEngine.php.

Set the language in which the diff text is written (Defaults to page content language).

Since:
1.19

Definition at line 965 of file DifferenceEngine.php.

DifferenceEngine::showDiff ( otitle,
ntitle,
notice = '' 
)

Get the diff text, send it to the OutputPage object Returns false if the diff could not be generated, otherwise returns true.

Returns:
bool

Definition at line 563 of file DifferenceEngine.php.

Referenced by RollbackAction\onView().

Definition at line 196 of file DifferenceEngine.php.

Referenced by SpecialComparePages\showDiff().

Add style sheets and supporting JS for diff display.

Definition at line 578 of file DifferenceEngine.php.

Definition at line 180 of file DifferenceEngine.php.

Returns:
bool

Definition at line 120 of file DifferenceEngine.php.


Member Data Documentation

DifferenceEngine::$enableDebugComment = false

Set this to true to add debug info to the HTML output.

Warning: this may cause RSS readers to spuriously mark articles as "new" (bug 20601)

Definition at line 62 of file DifferenceEngine.php.

DifferenceEngine::$mCacheHit = false

Definition at line 55 of file DifferenceEngine.php.

DifferenceEngine::$mDiffLang [protected]

Definition at line 42 of file DifferenceEngine.php.

DifferenceEngine::$mMarkPatrolledLink = null [protected]

Definition at line 69 of file DifferenceEngine.php.

DifferenceEngine::$mNewid

Definition at line 40 of file DifferenceEngine.php.

Title DifferenceEngine::$mNewPage

Definition at line 46 of file DifferenceEngine.php.

Revision DifferenceEngine::$mNewRev

Definition at line 51 of file DifferenceEngine.php.

DifferenceEngine::$mNewtext

Definition at line 41 of file DifferenceEngine.php.

DifferenceEngine::$mOldid

#@+

Access:
private

Definition at line 40 of file DifferenceEngine.php.

Title DifferenceEngine::$mOldPage

Definition at line 46 of file DifferenceEngine.php.

Revision DifferenceEngine::$mOldRev

Definition at line 51 of file DifferenceEngine.php.

DifferenceEngine::$mOldtext

Definition at line 41 of file DifferenceEngine.php.

DifferenceEngine::$mRcidMarkPatrolled

Definition at line 47 of file DifferenceEngine.php.

DifferenceEngine::$mReducedLineNumbers = false [protected]

Definition at line 66 of file DifferenceEngine.php.

DifferenceEngine::$mRevisionsIdsLoaded = false [private]

Definition at line 52 of file DifferenceEngine.php.

DifferenceEngine::$mRevisionsLoaded = false

Definition at line 53 of file DifferenceEngine.php.

DifferenceEngine::$mTextLoaded = 0

Definition at line 54 of file DifferenceEngine.php.

DifferenceEngine::$unhide = false [protected]

Definition at line 71 of file DifferenceEngine.php.


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