DifferenceEngine Class Reference
[DifferenceEngine]

List of all members.

Public Member Functions

 __construct ($titleObj=null, $old=0, $new=0, $rcid=0, $refreshCache=false, $htmldiff=false, $unhide=false)
 #@-
 getTitle ()
 wasCacheHit ()
 getOldid ()
 getNewid ()
 showDiffPage ($diffOnly=false)
 renderNewRevision ()
 Show the new revision of the page.
 renderHtmlDiff ()
 showFirstRevision ()
 Show the first revision of an article.
 htmlDiffArgument ()
 showDiff ($otitle, $ntitle)
 Get the diff text, send it to $wgOut Returns false if the diff could not be generated, otherwise returns true.
 showDiffStyle ()
 Add style sheets and supporting JS for diff display.
 getDiff ($otitle, $ntitle)
 Get complete diff table, including header.
 getDiffBody ()
 Get the diff table body, without header.
 generateDiffBody ($otext, $ntext)
 Generate a diff, no caching $otext and $ntext must be already segmented.
 localiseLineNumbers ($text)
 Replace line numbers with the text in the user's language.
 localiseLineNumbersCb ($matches)
 getMultiNotice ()
 If there are revisions between the ones being compared, return a note saying so.
 setText ($oldText, $newText)
 Use specified text instead of loading from the database.
 loadRevisionData ()
 Load revision metadata for the specified articles.
 loadText ()
 Load the text of the revisions, as well as revision data.
 loadNewText ()
 Load the text of the new revision, not the old one.

Static Public Member Functions

static addHeader ($diff, $otitle, $ntitle, $multi= '')
 Add the header to a diff body.

Public Attributes

 $mOldid
 #@+
 $mNewid
 $mTitle
 $mOldtitle
 $mNewtitle
 $mPagetitle
 $mOldtext
 $mNewtext
 $mOldPage
 $mNewPage
 $mRcidMarkPatrolled
 $mOldRev
 $mNewRev
 $mRevisionsLoaded = false
 $mTextLoaded = 0
 $mCacheHit = false
 $htmldiff

Protected Member Functions

 debug ($generator="internal")
 Generate a debug comment indicating diff generating time, server node, and generator backend.

Protected Attributes

 $unhide = false


Detailed Description

Todo:
document

Definition at line 18 of file DifferenceEngine.php.


Constructor & Destructor Documentation

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

#@-

Constructor

Parameters:
$titleObj Title object that the diff is associated with
$old Integer: old ID we want to show and diff with.
$new String: either 'prev' or 'next'.
$rcid Integer: ??? FIXME (default 0)
$refreshCache boolean If set, refreshes the diff cache
$htmldiff boolean If set, output using HTMLDiff instead of raw wikicode diff
$unhide boolean If set, allow viewing deleted revs

Definition at line 46 of file DifferenceEngine.php.

References $htmldiff, $unhide, wfDebug(), and wfRunHooks().


Member Function Documentation

static DifferenceEngine::addHeader ( diff,
otitle,
ntitle,
multi = '' 
) [static]

Add the header to a diff body.

Definition at line 757 of file DifferenceEngine.php.

Referenced by getDiff(), and showDiffPage().

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

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

Definition at line 699 of file DifferenceEngine.php.

References $wgShowHostnames, wfHostname(), and wfTimestamp().

Referenced by generateDiffBody().

DifferenceEngine::generateDiffBody ( otext,
ntext 
)

Generate a diff, no caching $otext and $ntext must be already segmented.

Definition at line 622 of file DifferenceEngine.php.

References $cmd, $text, $wgContLang, $wgExternalDiffEngine, $wgTmpDirectory, debug(), wfEscapeShellArg(), wfProfileIn(), wfProfileOut(), and wfShellExec().

Referenced by getDiffBody().

DifferenceEngine::getDiff ( otitle,
ntitle 
)

Get complete diff table, including header.

Parameters:
Title $otitle Old title
Title $ntitle New title
Returns:
mixed

Definition at line 546 of file DifferenceEngine.php.

References addHeader(), getDiffBody(), and getMultiNotice().

Referenced by showDiff().

DifferenceEngine::getDiffBody (  ) 

Get the diff table body, without header.

Returns:
mixed

Definition at line 561 of file DifferenceEngine.php.

References $key, $wgMemc, Revision::DELETED_TEXT, generateDiffBody(), loadRevisionData(), loadText(), localiseLineNumbers(), wfIncrStats(), wfMemcKey(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by getDiff().

DifferenceEngine::getMultiNotice (  ) 

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

Definition at line 731 of file DifferenceEngine.php.

References $n, and wfMsgExt().

Referenced by getDiff(), and showDiffPage().

DifferenceEngine::getNewid (  ) 

Definition at line 88 of file DifferenceEngine.php.

DifferenceEngine::getOldid (  ) 

Definition at line 84 of file DifferenceEngine.php.

DifferenceEngine::getTitle (  ) 

Definition at line 76 of file DifferenceEngine.php.

DifferenceEngine::htmlDiffArgument (  ) 

Definition at line 498 of file DifferenceEngine.php.

References $wgEnableHtmlDiff.

Referenced by showDiffPage().

DifferenceEngine::loadNewText (  ) 

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

Definition at line 923 of file DifferenceEngine.php.

References Revision::FOR_THIS_USER, and loadRevisionData().

Referenced by renderNewRevision(), and showFirstRevision().

DifferenceEngine::loadRevisionData (  ) 

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.

Definition at line 796 of file DifferenceEngine.php.

References $t, $wgLang, $wgUser, Revision::DELETED_TEXT, Revision::newFromId(), Revision::newFromTitle(), wfMsg(), and wfMsgHtml().

Referenced by getDiffBody(), loadNewText(), loadText(), and showDiffPage().

DifferenceEngine::loadText (  ) 

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

Definition at line 894 of file DifferenceEngine.php.

References Revision::FOR_THIS_USER, and loadRevisionData().

Referenced by getDiffBody(), and renderHtmlDiff().

DifferenceEngine::localiseLineNumbers ( text  ) 

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

Definition at line 717 of file DifferenceEngine.php.

References $text.

Referenced by getDiffBody().

DifferenceEngine::localiseLineNumbersCb ( matches  ) 

Definition at line 722 of file DifferenceEngine.php.

References $wgLang, and wfMsgExt().

DifferenceEngine::renderHtmlDiff (  ) 

DifferenceEngine::renderNewRevision (  ) 

Show the new revision of the page.

Definition at line 329 of file DifferenceEngine.php.

References $wgOut, $wgUser, Revision::DELETED_TEXT, loadNewText(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by showDiffPage().

DifferenceEngine::setText ( oldText,
newText 
)

Use specified text instead of loading from the database.

Definition at line 779 of file DifferenceEngine.php.

DifferenceEngine::showDiff ( otitle,
ntitle 
)

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

Definition at line 515 of file DifferenceEngine.php.

References $wgOut, getDiff(), and showDiffStyle().

Referenced by showDiffPage().

DifferenceEngine::showDiffPage ( diffOnly = false  ) 

DifferenceEngine::showDiffStyle (  ) 

Add style sheets and supporting JS for diff display.

Definition at line 531 of file DifferenceEngine.php.

References $wgOut, $wgStylePath, and $wgStyleVersion.

Referenced by renderHtmlDiff(), showDiff(), and showDiffPage().

DifferenceEngine::showFirstRevision (  ) 

Show the first revision of an article.

Uses normal diff headers in contrast to normal "old revision" display style.

Definition at line 449 of file DifferenceEngine.php.

References $t, $wgOut, $wgUser, loadNewText(), wfMsg(), wfMsgExt(), wfMsgHtml(), wfProfileIn(), and wfProfileOut().

Referenced by showDiffPage().

DifferenceEngine::wasCacheHit (  ) 

Definition at line 80 of file DifferenceEngine.php.


Member Data Documentation

DifferenceEngine::$htmldiff

Definition at line 31 of file DifferenceEngine.php.

Referenced by __construct().

DifferenceEngine::$mCacheHit = false

Definition at line 30 of file DifferenceEngine.php.

DifferenceEngine::$mNewid

Definition at line 22 of file DifferenceEngine.php.

DifferenceEngine::$mNewPage

Definition at line 25 of file DifferenceEngine.php.

DifferenceEngine::$mNewRev

Definition at line 27 of file DifferenceEngine.php.

DifferenceEngine::$mNewtext

Definition at line 24 of file DifferenceEngine.php.

DifferenceEngine::$mNewtitle

Definition at line 23 of file DifferenceEngine.php.

DifferenceEngine::$mOldid

#@+

Access:
private

Definition at line 22 of file DifferenceEngine.php.

DifferenceEngine::$mOldPage

Definition at line 25 of file DifferenceEngine.php.

DifferenceEngine::$mOldRev

Definition at line 27 of file DifferenceEngine.php.

DifferenceEngine::$mOldtext

Definition at line 24 of file DifferenceEngine.php.

DifferenceEngine::$mOldtitle

Definition at line 23 of file DifferenceEngine.php.

DifferenceEngine::$mPagetitle

Definition at line 23 of file DifferenceEngine.php.

DifferenceEngine::$mRcidMarkPatrolled

Definition at line 26 of file DifferenceEngine.php.

DifferenceEngine::$mRevisionsLoaded = false

Definition at line 28 of file DifferenceEngine.php.

DifferenceEngine::$mTextLoaded = 0

Definition at line 29 of file DifferenceEngine.php.

DifferenceEngine::$mTitle

Definition at line 22 of file DifferenceEngine.php.

DifferenceEngine::$unhide = false [protected]

Definition at line 33 of file DifferenceEngine.php.

Referenced by __construct().


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

Generated on Sat Sep 5 02:08:36 2009 for MediaWiki by  doxygen 1.5.9