* @param bool $refreshCache If set, refreshes the diff cache
* @param bool $unhide If set, allow viewing deleted revs
*/
- function __construct( $context = null, $old = 0, $new = 0, $rcid = 0,
- $refreshCache = false, $unhide = false ) {
+ public function __construct( $context = null, $old = 0, $new = 0, $rcid = 0,
+ $refreshCache = false, $unhide = false
+ ) {
if ( $context instanceof IContextSource ) {
$this->setContext( $context );
}
/**
* @param bool $value
*/
- function setReducedLineNumbers( $value = true ) {
+ public function setReducedLineNumbers( $value = true ) {
$this->mReducedLineNumbers = $value;
}
/**
* @return Language
*/
- function getDiffLang() {
+ public function getDiffLang() {
if ( $this->mDiffLang === null ) {
# Default language in which the diff text is written.
$this->mDiffLang = $this->getTitle()->getPageLanguage();
/**
* @return bool
*/
- function wasCacheHit() {
+ public function wasCacheHit() {
return $this->mCacheHit;
}
/**
* @return int
*/
- function getOldid() {
+ public function getOldid() {
$this->loadRevisionIds();
return $this->mOldid;
/**
* @return bool|int
*/
- function getNewid() {
+ public function getNewid() {
$this->loadRevisionIds();
return $this->mNewid;
*
* @return mixed URL or false
*/
- function deletedLink( $id ) {
+ public function deletedLink( $id ) {
if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
$dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'archive', '*',
*
* @return string Wikitext fragment
*/
- function deletedIdMarker( $id ) {
+ public function deletedIdMarker( $id ) {
$link = $this->deletedLink( $id );
if ( $link ) {
return "[$link $id]";
$this->getLanguage()->listToText( $missing ), count( $missing ) );
}
- function showDiffPage( $diffOnly = false ) {
+ public function showDiffPage( $diffOnly = false ) {
wfProfileIn( __METHOD__ );
# Allow frames except in certain special cases
/**
* Show the new revision of the page.
*/
- function renderNewRevision() {
+ public function renderNewRevision() {
wfProfileIn( __METHOD__ );
$out = $this->getOutput();
$revHeader = $this->getRevisionHeader( $this->mNewRev );
*
* @return bool
*/
- function showDiff( $otitle, $ntitle, $notice = '' ) {
+ public function showDiff( $otitle, $ntitle, $notice = '' ) {
$diff = $this->getDiff( $otitle, $ntitle, $notice );
if ( $diff === false ) {
$this->showMissingRevision();
/**
* Add style sheets and supporting JS for diff display.
*/
- function showDiffStyle() {
+ public function showDiffStyle() {
$this->getOutput()->addModuleStyles( 'mediawiki.action.history.diff' );
}
*
* @return mixed
*/
- function getDiff( $otitle, $ntitle, $notice = '' ) {
+ public function getDiff( $otitle, $ntitle, $notice = '' ) {
$body = $this->getDiffBody();
if ( $body === false ) {
return false;
* @throws MWException If old or new content is not an instance of TextContent.
* @return bool|string
*/
- function generateContentDiffBody( Content $old, Content $new ) {
+ public function generateContentDiffBody( Content $old, Content $new ) {
if ( !( $old instanceof TextContent ) ) {
throw new MWException( "Diff not implemented for " . get_class( $old ) . "; " .
"override generateContentDiffBody to fix this." );
* @return bool|string
* @deprecated since 1.21, use generateContentDiffBody() instead!
*/
- function generateDiffBody( $otext, $ntext ) {
+ public function generateDiffBody( $otext, $ntext ) {
ContentHandler::deprecated( __METHOD__, "1.21" );
return $this->generateTextDiffBody( $otext, $ntext );
*
* @return bool|string
*/
- function generateTextDiffBody( $otext, $ntext ) {
+ public function generateTextDiffBody( $otext, $ntext ) {
global $wgExternalDiffEngine, $wgContLang;
wfProfileIn( __METHOD__ );
*
* @return mixed
*/
- function localiseLineNumbers( $text ) {
+ public function localiseLineNumbers( $text ) {
return preg_replace_callback(
'/<!--LINE (\d+)-->/',
array( &$this, 'localiseLineNumbersCb' ),
);
}
- function localiseLineNumbersCb( $matches ) {
+ public function localiseLineNumbersCb( $matches ) {
if ( $matches[1] === '1' && $this->mReducedLineNumbers ) {
return '';
}
*
* @return string
*/
- function getMultiNotice() {
+ public function getMultiNotice() {
if ( !is_object( $this->mOldRev ) || !is_object( $this->mNewRev ) ) {
return '';
} elseif ( !$this->mOldPage->equals( $this->mNewPage ) ) {
*
* @return string
*/
- function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {
+ public function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {
// shared.css sets diff in interface language/dir, but the actual content
// is often in a different language, mostly the page content language/dir
$tableClass = 'diff diff-contentalign-' . htmlspecialchars( $this->getDiffLang()->alignStart() );
* Use specified text instead of loading from the database
* @deprecated since 1.21, use setContent() instead.
*/
- function setText( $oldText, $newText ) {
+ public function setText( $oldText, $newText ) {
ContentHandler::deprecated( __METHOD__, "1.21" );
$oldContent = ContentHandler::makeContent( $oldText, $this->getTitle() );
* Use specified text instead of loading from the database
* @since 1.21
*/
- function setContent( Content $oldContent, Content $newContent ) {
+ public function setContent( Content $oldContent, Content $newContent ) {
$this->mOldContent = $oldContent;
$this->mNewContent = $newContent;
* (Defaults to page content language).
* @since 1.19
*/
- function setTextLanguage( $lang ) {
+ public function setTextLanguage( $lang ) {
$this->mDiffLang = wfGetLangObj( $lang );
}
*
* @return bool
*/
- function loadRevisionData() {
+ public function loadRevisionData() {
if ( $this->mRevisionsLoaded ) {
return true;
}
*
* @return bool
*/
- function loadText() {
+ public function loadText() {
if ( $this->mTextLoaded == 2 ) {
return true;
}
*
* @return bool
*/
- function loadNewText() {
+ public function loadNewText() {
if ( $this->mTextLoaded >= 1 ) {
return true;
}