DifferenceEngine Class Reference
[DifferenceEngine]

List of all members.

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.


Detailed Description

Todo:
document

Definition at line 18 of file DifferenceInterface.php.


Constructor & Destructor Documentation

DifferenceEngine::__construct ( titleObj = null,
old = 0,
new = 0,
rcid = 0,
refreshCache = 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
$unhide boolean If set, allow viewing deleted revs

Definition at line 55 of file DifferenceInterface.php.

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


Member Function Documentation

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.

Parameters:
Title $otitle Old title
Title $ntitle New title
string $notice HTML between diff header and body
Returns:
mixed

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.

Returns:
mixed

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  ) 

Definition at line 768 of file DifferenceInterface.php.

References $wgLang, and wfMsgExt().

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  ) 

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.


Member Data Documentation

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

#@+

Access:
private

Definition at line 22 of file DifferenceInterface.php.

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]

Definition at line 43 of file DifferenceInterface.php.

Referenced by __construct().


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

Generated on Sat Apr 30 22:57:36 2011 for MediaWiki by  doxygen 1.5.9