Jump to content

User:Tgr (WMF)/DifferenceEngine/entry points

From mediawiki.org

Object creation

[edit]

new DifferenceEngine

[edit]

Callers / calls:

ContentHandler::createDifferenceEngine

[edit]

Callers / calls:

  • Article::showDiffPage (diff view)
    • mNewid (get)
    • showDiffPage()
    • mapDiffPrevNext()
  • EditPage::showDiff (edit diff when previewing changes)
    • setContent()
    • getDiff()
    • showDiffStyle()
  • ApiQueryRevisionsBase (diffto/difftotext parameters, deprecated)
    • setContent()
    • getOldid() / getNewid()
    • getDiffBody()
    • wasCacheHit()
  • FeedUtils::formatDiffRow (RC RSS feed)
    • getDiff()
  • RollbackAction:onView (diff after successful rollback)
    • showDiff()
  • SpecialComparePages::showDiff (???)
    • showDiffPage()
  • SpecialUndelete::showDiff (act like history page but with deleted revisions included)
    • showDiffStyle()
    • generateContentDiffBody()
    • addHeader()
  • TextConflictHelper::showEditFormTextAfterFooters (diff on edit conflict)
    • setContent()
    • showDiff()
  • MobileFrontend SpecialMobileDiff::displayDiffPage (mobile diff view)
    • showDiffPage()

GetDifferenceEngine

[edit]
(Called when getting a new difference engine interface object Return false for valid object in $differenceEngine or true for the default difference engine.)

Handlers / overrides:

  • WikEdDiff:
    • generateTextDiffBody

Exposes object

[edit]

DifferenceEngineAfterLoadNewText

[edit]
(called in DifferenceEngine::loadNewText() after the new revision's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function.)

(no handlers in gerrit)

DifferenceEngineLoadTextAfterNewContentIsLoaded

[edit]
(called in DifferenceEngine::loadText() after the new revision's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable's value is null. This hook can be used to inject content into said class member variable.)

(no handlers in gerrit)

[edit]
(Allows extensions to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink".)

(no handlers in gerrit)

DifferenceEngineMarkPatrolledRCID

[edit]
(Allows extensions to possibly change the rcid parameter. For example the rcid might be set to zero due to the user being the same as the performer of the change but an extension might still want to show it under certain conditions.)

(no handlers in gerrit)

DifferenceEngineNewHeader

[edit]
(Allows extensions to change the $newHeader variable, which contains information about the new revision, such as the revision's author, whether the revision was marked as a minor edit or not, etc.)

Handlers / calls:

  • SocialProfile
    • mOldRev (get)


DifferenceEngineOldHeader

[edit]
(Allows extensions to change the $oldHeader variable, which contains information about the old revision, such as the revision's author, whether the revision was marked as a minor edit or not, etc.)

Handlers / calls:

  • SocialProfile
    • getRevisionHeader()
    • mNewRev (get)
    • markPatrolledLink()

DifferenceEngineRenderRevisionAddParserOutput

[edit]
(Allows extensions to change the parser output. Return false to not add parser output via OutputPage's addParserOutput method.)

(no handlers in gerrit)

DifferenceEngineShowDiff

[edit]
(Allows extensions to affect the diff text which eventually gets sent to the OutputPage object.)

Handlers / calls:

  • SocialProfile
    • getOutput() (adds extra styles)

DifferenceEngineShowEmptyOldContent

[edit]
(Allows extensions to change the diff table body (without header) in cases when there is no old revision or the old and new revisions are identical.)

(no handlers in gerrit)

DifferenceEngineShowDiffPageMaybeShowMissingRevision

[edit]
(called in DifferenceEngine::showDiffPage() when revision data cannot be loaded. Return false in order to prevent displaying the missing revision message (i.e. to prevent DifferenceEngine::showMissingRevision() from being called).)

(no handlers in gerrit)

AbortDiffCache

[edit]
(Can be used to cancel the caching of a diff.)

(no handlers in gerrit)

DiffViewHeader

[edit]
(Called before diff display)

Handlers / calls:

ArticleContentOnDiff

[edit]
(Before showing the article content below a diff. Use this to change the content in this area or how it is loaded.)

Handlers / calls:

  • Translate
    • getTitle()
    • loadNewText()
    • mNewContent (get)
  • TimedMediaHandler (not used)

Exposes internal state

[edit]

NewDifferenceEngine

[edit]
(Called when a new DifferenceEngine object is made)
Exposes $oldId, $newId

Handlers / changes:

  • FlaggedRevs
    • handles special URL parameter value 'diff=review': sets oldid to stable ID, newid to 0