Public Member Functions | |
__construct ($titleObj=null, $old=0, $new=0, $rcid=0, $refreshCache=false, $unhide=false) | |
#@- | |
setReducedLineNumbers ($value=true) | |
getTitle () | |
wasCacheHit () | |
getOldid () | |
getNewid () | |
showDiffPage ($diffOnly=false) | |
renderNewRevision () | |
Show the new revision of the page. | |
showFirstRevision () | |
Show the first revision of an article. | |
showDiff ($otitle, $ntitle, $notice= '') | |
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, $notice= '') | |
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= '', $notice= '') |
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 | |
$enableDebugComment = false | |
Set this to true to add debug info to the HTML output. | |
Protected Member Functions | |
revisionDeleteLink ($rev) | |
debug ($generator="internal") | |
Generate a debug comment indicating diff generating time, server node, and generator backend. | |
Protected Attributes | |
$mReducedLineNumbers = false | |
$unhide = false | |
Private Member Functions | |
initDiffEngines () | |
Make sure the proper modules are loaded before we try to make the diff. |
Definition at line 18 of file DifferenceInterface.php.
DifferenceEngine::__construct | ( | $ | titleObj = null , |
|
$ | old = 0 , |
|||
$ | new = 0 , |
|||
$ | rcid = 0 , |
|||
$ | refreshCache = 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 | |
$unhide | boolean If set, allow viewing deleted revs |
Definition at line 55 of file DifferenceInterface.php.
References $unhide, $wgTitle, wfDebug(), and wfRunHooks().
static DifferenceEngine::addHeader | ( | $ | diff, | |
$ | otitle, | |||
$ | ntitle, | |||
$ | multi = '' , |
|||
$ | notice = '' | |||
) | [static] |
Add the header to a diff body.
Definition at line 804 of file DifferenceInterface.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 742 of file DifferenceInterface.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 673 of file DifferenceInterface.php.
References $wgContLang, $wgExternalDiffEngine, $wgTmpDirectory, debug(), initDiffEngines(), wfEscapeShellArg(), wfProfileIn(), wfProfileOut(), and wfShellExec().
Referenced by getDiffBody().
DifferenceEngine::getDiff | ( | $ | otitle, | |
$ | ntitle, | |||
$ | notice = '' | |||
) |
Get complete diff table, including header.
Title | $otitle Old title | |
Title | $ntitle New title | |
string | $notice HTML between diff header and body |
Definition at line 575 of file DifferenceInterface.php.
References addHeader(), getDiffBody(), and getMultiNotice().
Referenced by showDiff().
DifferenceEngine::getDiffBody | ( | ) |
Get the diff table body, without header.
Definition at line 590 of file DifferenceInterface.php.
References $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 778 of file DifferenceInterface.php.
References $n, and wfMsgExt().
Referenced by getDiff(), and showDiffPage().
DifferenceEngine::getNewid | ( | ) |
Definition at line 107 of file DifferenceInterface.php.
Referenced by ApiQueryRevisions::extractRowInfo().
DifferenceEngine::getOldid | ( | ) |
Definition at line 103 of file DifferenceInterface.php.
DifferenceEngine::getTitle | ( | ) |
Definition at line 95 of file DifferenceInterface.php.
DifferenceEngine::initDiffEngines | ( | ) | [private] |
Make sure the proper modules are loaded before we try to make the diff.
Definition at line 651 of file DifferenceInterface.php.
References $wgExternalDiffEngine, wfProfileIn(), wfProfileOut(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by generateDiffBody().
DifferenceEngine::loadNewText | ( | ) |
Load the text of the new revision, not the old one.
Definition at line 1012 of file DifferenceInterface.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 854 of file DifferenceInterface.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 983 of file DifferenceInterface.php.
References Revision::FOR_THIS_USER, and loadRevisionData().
Referenced by getDiffBody().
DifferenceEngine::localiseLineNumbers | ( | $ | text | ) |
Replace line numbers with the text in the user's language.
Definition at line 763 of file DifferenceInterface.php.
Referenced by getDiffBody().
DifferenceEngine::localiseLineNumbersCb | ( | $ | matches | ) |
DifferenceEngine::renderNewRevision | ( | ) |
Show the new revision of the page.
Definition at line 415 of file DifferenceInterface.php.
References $wgOut, $wgUser, Revision::DELETED_TEXT, loadNewText(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by showDiffPage().
DifferenceEngine::revisionDeleteLink | ( | $ | rev | ) | [protected] |
Definition at line 387 of file DifferenceInterface.php.
References $wgUser, and Revision::DELETED_RESTRICTED.
Referenced by showDiffPage().
DifferenceEngine::setReducedLineNumbers | ( | $ | value = true |
) |
Definition at line 91 of file DifferenceInterface.php.
DifferenceEngine::setText | ( | $ | oldText, | |
$ | newText | |||
) |
Use specified text instead of loading from the database.
Definition at line 837 of file DifferenceInterface.php.
DifferenceEngine::showDiff | ( | $ | otitle, | |
$ | ntitle, | |||
$ | notice = '' | |||
) |
Get the diff text, send it to $wgOut Returns false if the diff could not be generated, otherwise returns true.
Definition at line 543 of file DifferenceInterface.php.
References $wgOut, getDiff(), and showDiffStyle().
Referenced by showDiffPage().
DifferenceEngine::showDiffPage | ( | $ | diffOnly = false |
) |
Definition at line 111 of file DifferenceInterface.php.
References $msg, $t, $wgInputEncoding, $wgLang, $wgOut, $wgScript, $wgServer, $wgUseExternalEditor, $wgUser, $wgUseRCPatrol, addHeader(), Revision::DELETED_RESTRICTED, Revision::DELETED_TEXT, ChangesList::flag(), getMultiNotice(), loadRevisionData(), RecentChange::newFromConds(), RecentChange::newFromId(), renderNewRevision(), revisionDeleteLink(), showDiff(), showDiffStyle(), showFirstRevision(), csslex::URL, wfGetDB(), wfMsg(), wfMsgExt(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
DifferenceEngine::showDiffStyle | ( | ) |
Add style sheets and supporting JS for diff display.
Definition at line 559 of file DifferenceInterface.php.
References $wgOut, $wgStylePath, and $wgStyleVersion.
Referenced by 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 477 of file DifferenceInterface.php.
References $t, $wgOut, $wgUser, loadNewText(), wfMsg(), wfMsgExt(), wfMsgHtml(), wfProfileIn(), and wfProfileOut().
Referenced by showDiffPage().
DifferenceEngine::wasCacheHit | ( | ) |
Definition at line 99 of file DifferenceInterface.php.
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 37 of file DifferenceInterface.php.
DifferenceEngine::$mCacheHit = false |
Definition at line 30 of file DifferenceInterface.php.
DifferenceEngine::$mNewid |
Definition at line 22 of file DifferenceInterface.php.
DifferenceEngine::$mNewPage |
Definition at line 25 of file DifferenceInterface.php.
DifferenceEngine::$mNewRev |
Definition at line 27 of file DifferenceInterface.php.
DifferenceEngine::$mNewtext |
Definition at line 24 of file DifferenceInterface.php.
DifferenceEngine::$mNewtitle |
Definition at line 23 of file DifferenceInterface.php.
DifferenceEngine::$mOldid |
DifferenceEngine::$mOldPage |
Definition at line 25 of file DifferenceInterface.php.
DifferenceEngine::$mOldRev |
Definition at line 27 of file DifferenceInterface.php.
DifferenceEngine::$mOldtext |
Definition at line 24 of file DifferenceInterface.php.
DifferenceEngine::$mOldtitle |
Definition at line 23 of file DifferenceInterface.php.
DifferenceEngine::$mPagetitle |
Definition at line 23 of file DifferenceInterface.php.
DifferenceEngine::$mRcidMarkPatrolled |
Definition at line 26 of file DifferenceInterface.php.
DifferenceEngine::$mReducedLineNumbers = false [protected] |
Definition at line 41 of file DifferenceInterface.php.
DifferenceEngine::$mRevisionsLoaded = false |
Definition at line 28 of file DifferenceInterface.php.
DifferenceEngine::$mTextLoaded = 0 |
Definition at line 29 of file DifferenceInterface.php.
DifferenceEngine::$mTitle |
Definition at line 22 of file DifferenceInterface.php.
DifferenceEngine::$unhide = false [protected] |