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 |
Definition at line 18 of file DifferenceEngine.php.
DifferenceEngine::__construct | ( | $ | titleObj = null , |
|
$ | old = 0 , |
|||
$ | new = 0 , |
|||
$ | rcid = 0 , |
|||
$ | refreshCache = false , |
|||
$ | htmldiff = false , |
|||
$ | unhide = false | |||
) |
#@-
Constructor
$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().
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.
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.
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 | ) |
DifferenceEngine::renderHtmlDiff | ( | ) |
Definition at line 382 of file DifferenceEngine.php.
References $wgDebugComments, $wgOut, $wgParser, $wgTitle, Revision::DELETED_TEXT, HTMLDiffer::getDebugOutput(), loadText(), showDiffStyle(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by showDiffPage().
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 |
) |
Definition at line 92 of file DifferenceEngine.php.
References $db, $t, $wgEnableHtmlDiff, $wgInputEncoding, $wgLang, $wgOut, $wgScript, $wgServer, $wgUseExternalEditor, $wgUser, $wgUseRCPatrol, addHeader(), Revision::DELETED_RESTRICTED, Revision::DELETED_TEXT, getMultiNotice(), htmlDiffArgument(), loadRevisionData(), RecentChange::newFromConds(), RecentChange::newFromId(), renderHtmlDiff(), renderNewRevision(), showDiff(), showDiffStyle(), showFirstRevision(), Xml::span(), Xml::tags(), wfGetDB(), wfMsg(), wfMsgExt(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
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.
DifferenceEngine::$htmldiff |
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 |
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] |