MediaWiki
REL1_22
|
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. | |
generateContentDiffBody (Content $old, Content $new) | |
Generate a diff, no caching. | |
generateDiffBody ($otext, $ntext) | |
Generate a diff, no caching. | |
generateTextDiffBody ($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. | |
setContent (Content $oldContent, Content $newContent) | |
Use specified text instead of loading from the database. | |
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 | |
Content | $mNewContent |
$mNewid | |
Title | $mNewPage |
Revision | $mNewRev |
$mNewTags | |
Content | $mOldContent |
$mOldid | |
#@+ | |
Title | $mOldPage |
Revision | $mOldRev |
$mOldTags | |
$mRevisionsLoaded = false | |
$mTextLoaded = 0 | |
Protected Member Functions | |
debug ($generator="internal") | |
Generate a debug comment indicating diff generating time, server node, and generator backend. | |
getParserOutput (WikiPage $page, Revision $rev) | |
getRevisionHeader (Revision $rev, $complete= '') | |
Get a header for a specified revision. | |
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 | |
loadRevisionIds () | |
Load revision IDs. | |
showMissingRevision () | |
Private Attributes | |
$mRevisionsIdsLoaded = false |
Definition at line 36 of file DifferenceEngine.php.
DifferenceEngine::__construct | ( | $ | context = null , |
$ | old = 0 , |
||
$ | new = 0 , |
||
$ | rcid = 0 , |
||
$ | refreshCache = false , |
||
$ | unhide = false |
||
) |
#@-
Constructor
$context | IContextSource context to use, anything else will be ignored |
$old | Integer old ID we want to show and diff with. |
$new | String either 'prev' or 'next'. |
$rcid | Integer Deprecated, no longer used! |
$refreshCache | boolean If set, refreshes the diff cache |
$unhide | boolean If set, allow viewing deleted revs |
Definition at line 85 of file DifferenceEngine.php.
DifferenceEngine::addHeader | ( | $ | diff, |
$ | otitle, | ||
$ | ntitle, | ||
$ | multi = '' , |
||
$ | notice = '' |
||
) |
DifferenceEngine::debug | ( | $ | generator = "internal" | ) | [protected] |
Generate a debug comment indicating diff generating time, server node, and generator backend.
Definition at line 827 of file DifferenceEngine.php.
Build a wikitext link toward a deleted revision, if viewable.
int | $id | revision ID |
Definition at line 172 of file DifferenceEngine.php.
DifferenceEngine::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.
int | $id | revision ID |
Definition at line 148 of file DifferenceEngine.php.
DifferenceEngine::generateContentDiffBody | ( | Content $ | old, |
Content $ | new | ||
) |
Generate a diff, no caching.
This implementation uses generateTextDiffBody() to generate a diff based on the default serialization of the given Content objects. This will fail if $old or $new are not instances of TextContent.
Subclasses may override this to provide a different rendering for the diff, perhaps taking advantage of the content's native form. This is required for all content models that are not text based.
MWException | if $old or $new are not instances of TextContent. |
Definition at line 713 of file DifferenceEngine.php.
DifferenceEngine::generateDiffBody | ( | $ | otext, |
$ | ntext | ||
) |
Generate a diff, no caching.
string | $otext | old text, must be already segmented |
string | $ntext | new text, must be already segmented |
Definition at line 738 of file DifferenceEngine.php.
DifferenceEngine::generateTextDiffBody | ( | $ | otext, |
$ | ntext | ||
) |
Generate a diff, no caching.
string | $otext | old text, must be already segmented |
string | $ntext | new text, must be already segmented |
Definition at line 753 of file DifferenceEngine.php.
DifferenceEngine::getDiff | ( | $ | otitle, |
$ | ntitle, | ||
$ | notice = '' |
||
) |
Get complete diff table, including header.
string | bool | $otitle | Header for old text or false |
string | bool | $ntitle | Header for new text or false |
string | $notice | HTML between diff header and body |
Definition at line 610 of file DifferenceEngine.php.
Get the diff table body, without header.
Definition at line 629 of file DifferenceEngine.php.
Definition at line 110 of file DifferenceEngine.php.
If there are revisions between the ones being compared, return a note saying so.
Definition at line 865 of file DifferenceEngine.php.
Definition at line 136 of file DifferenceEngine.php.
Definition at line 128 of file DifferenceEngine.php.
DifferenceEngine::getParserOutput | ( | WikiPage $ | page, |
Revision $ | rev | ||
) | [protected] |
Definition at line 566 of file DifferenceEngine.php.
DifferenceEngine::getRevisionHeader | ( | Revision $ | rev, |
$ | complete = '' |
||
) | [protected] |
Get a header for a specified revision.
$rev | Revision | |
string | $complete | 'complete' to get the header wrapped depending the visibility of the revision and a link to edit the page. |
Definition at line 915 of file DifferenceEngine.php.
static DifferenceEngine::intermediateEditsMsg | ( | $ | numEdits, |
$ | numUsers, | ||
$ | limit | ||
) | [static] |
Get a notice about how many intermediate edits and users there are.
$numEdits | int |
$numUsers | int |
$limit | int |
Definition at line 897 of file DifferenceEngine.php.
Load the text of the new revision, not the old one.
Definition at line 1196 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.
Definition at line 1088 of file DifferenceEngine.php.
DifferenceEngine::loadRevisionIds | ( | ) | [private] |
Load revision IDs.
Definition at line 1044 of file DifferenceEngine.php.
Load the text of the revisions, as well as revision data.
Definition at line 1162 of file DifferenceEngine.php.
DifferenceEngine::localiseLineNumbers | ( | $ | text | ) |
Replace line numbers with the text in the user's language.
Definition at line 849 of file DifferenceEngine.php.
DifferenceEngine::localiseLineNumbersCb | ( | $ | matches | ) |
Definition at line 854 of file DifferenceEngine.php.
DifferenceEngine::markPatrolledLink | ( | ) | [protected] |
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: When the patrol link is build, this method will call OutputPage::preventClickjacking() and load mediawiki.page.patrol.ajax.
Definition at line 418 of file DifferenceEngine.php.
Show the new revision of the page.
Definition at line 497 of file DifferenceEngine.php.
DifferenceEngine::revisionDeleteLink | ( | $ | rev | ) | [protected] |
DifferenceEngine::setContent | ( | Content $ | oldContent, |
Content $ | newContent | ||
) |
Use specified text instead of loading from the database.
Definition at line 1024 of file DifferenceEngine.php.
DifferenceEngine::setReducedLineNumbers | ( | $ | value = true | ) |
$value | bool |
Definition at line 103 of file DifferenceEngine.php.
DifferenceEngine::setText | ( | $ | oldText, |
$ | newText | ||
) |
Use specified text instead of loading from the database.
Definition at line 1011 of file DifferenceEngine.php.
DifferenceEngine::setTextLanguage | ( | $ | lang | ) |
Set the language in which the diff text is written (Defaults to page content language).
Definition at line 1037 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.
Definition at line 583 of file DifferenceEngine.php.
DifferenceEngine::showDiffPage | ( | $ | diffOnly = false | ) |
Definition at line 201 of file DifferenceEngine.php.
Add style sheets and supporting JS for diff display.
Definition at line 598 of file DifferenceEngine.php.
DifferenceEngine::showMissingRevision | ( | ) | [private] |
Definition at line 181 of file DifferenceEngine.php.
Definition at line 121 of file DifferenceEngine.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 64 of file DifferenceEngine.php.
DifferenceEngine::$mCacheHit = false |
Definition at line 57 of file DifferenceEngine.php.
DifferenceEngine::$mDiffLang [protected] |
Definition at line 45 of file DifferenceEngine.php.
DifferenceEngine::$mMarkPatrolledLink = null [protected] |
Definition at line 71 of file DifferenceEngine.php.
Content DifferenceEngine::$mNewContent |
Definition at line 44 of file DifferenceEngine.php.
DifferenceEngine::$mNewid |
Definition at line 40 of file DifferenceEngine.php.
Title DifferenceEngine::$mNewPage |
Definition at line 49 of file DifferenceEngine.php.
Revision DifferenceEngine::$mNewRev |
Definition at line 53 of file DifferenceEngine.php.
DifferenceEngine::$mNewTags |
Definition at line 41 of file DifferenceEngine.php.
Content DifferenceEngine::$mOldContent |
Definition at line 44 of file DifferenceEngine.php.
DifferenceEngine::$mOldid |
Title DifferenceEngine::$mOldPage |
Definition at line 49 of file DifferenceEngine.php.
Revision DifferenceEngine::$mOldRev |
Definition at line 53 of file DifferenceEngine.php.
DifferenceEngine::$mOldTags |
Definition at line 41 of file DifferenceEngine.php.
DifferenceEngine::$mReducedLineNumbers = false [protected] |
Definition at line 68 of file DifferenceEngine.php.
DifferenceEngine::$mRevisionsIdsLoaded = false [private] |
Definition at line 54 of file DifferenceEngine.php.
DifferenceEngine::$mRevisionsLoaded = false |
Definition at line 55 of file DifferenceEngine.php.
DifferenceEngine::$mTextLoaded = 0 |
Definition at line 56 of file DifferenceEngine.php.
DifferenceEngine::$unhide = false [protected] |
Definition at line 73 of file DifferenceEngine.php.