* @param $oldId Integer revision ID, null to fetch from request, zero for current
*/
public function __construct( Title $title, $oldId = null ) {
+ // FIXME: does the reference play any role here?
$this->mTitle =& $title;
$this->mOldId = $oldId;
}
/**
- * Constructor from an article article
+ * Constructor from an page id
* @param $id The article ID to load
*/
public static function newFromID( $id ) {
* @return mixed Title object, or null if this page is not a redirect
*/
public function getRedirectTarget() {
- if ( !$this->mTitle || !$this->mTitle->isRedirect() ) {
+ if ( !$this->mTitle->isRedirect() ) {
return null;
}
- if ( !is_null( $this->mRedirectTarget ) ) {
+ if ( $this->mRedirectTarget !== null ) {
return $this->mRedirectTarget;
}
# Query the redirect table
$dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'redirect',
- array( 'rd_namespace', 'rd_title' ),
+ array( 'rd_namespace', 'rd_title', 'rd_fragment', 'rd_interwiki' ),
array( 'rd_from' => $this->getID() ),
__METHOD__
);
- if ( $row ) {
- return $this->mRedirectTarget = Title::makeTitle( $row->rd_namespace, $row->rd_title );
+ // rd_fragment and rd_interwiki were added later, populate them if empty
+ if ( $row && !is_null( $row->rd_fragment ) && !is_null( $row->rd_interwiki ) ) {
+ return $this->mRedirectTarget = Title::makeTitle(
+ $row->rd_namespace, $row->rd_title,
+ $row->rd_fragment, $row->rd_interwiki );
}
# This page doesn't have an entry in the redirect table
* Insert an entry for this page into the redirect table.
*
* Don't call this function directly unless you know what you're doing.
- * @return Title object
+ * @return Title object or null if not a redirect
*/
public function insertRedirect() {
- $retval = Title::newFromRedirect( $this->getContent() );
-
+ // recurse through to only get the final target
+ $retval = Title::newFromRedirectRecurse( $this->getContent() );
if ( !$retval ) {
return null;
}
-
+ $this->insertRedirectEntry( $retval );
+ return $retval;
+ }
+
+ /**
+ * Insert or update the redirect table entry for this page to indicate
+ * it redirects to $rt .
+ * @param $rt Title redirect target
+ */
+ public function insertRedirectEntry( $rt ) {
$dbw = wfGetDB( DB_MASTER );
$dbw->replace( 'redirect', array( 'rd_from' ),
array(
'rd_from' => $this->getID(),
- 'rd_namespace' => $retval->getNamespace(),
- 'rd_title' => $retval->getDBkey()
+ 'rd_namespace' => $rt->getNamespace(),
+ 'rd_title' => $rt->getDBkey(),
+ 'rd_fragment' => $rt->getFragment(),
+ 'rd_interwiki' => $rt->getInterwiki(),
),
__METHOD__
);
-
- return $retval;
}
/**
- * Get the Title object this page redirects to
+ * Get the Title object or URL this page redirects to
*
* @return mixed false, Title of in-wiki target, or string with URL
*/
public function followRedirect() {
- $text = $this->getContent();
-
- return $this->followRedirectText( $text );
+ return $this->getRedirectURL( $this->getRedirectTarget() );
}
/**
*
* @param $text string article content containing redirect info
* @return mixed false, Title of in-wiki target, or string with URL
+ * @deprecated
*/
public function followRedirectText( $text ) {
- $rt = Title::newFromRedirectRecurse( $text ); // recurse through to only get the final target
- # process if title object is valid and not special:userlogout
-
+ // recurse through to only get the final target
+ return $this->getRedirectURL( Title::newFromRedirectRecurse( $text ) );
+ }
+
+ /**
+ * Get the Title object or URL to use for a redirect. We use Title
+ * objects for same-wiki, non-special redirects and URLs for everything
+ * else.
+ * @param $rt Title Redirect target
+ * @return mixed false, Title object of local target, or string with URL
+ */
+ public function getRedirectURL( $rt ) {
if ( $rt ) {
if ( $rt->getInterwiki() != '' ) {
if ( $rt->isLocal() ) {
}
/**
- * get the title object of the article
- * @return Title object of current title
+ * Get the title object of the article
+ * @return Title object of this page
*/
public function getTitle() {
return $this->mTitle;
/**
* Clear the object
+ * FIXME: shouldn't this be public?
* @private
*/
public function clear() {
* If you need to fetch redirectable content easily, try
* the shortcut in Article::followRedirect()
*
+ * This function has side effects! Do not use this function if you
+ * only want the real revision text if any.
+ *
* @return Return the text of this revision
*/
public function getContent() {
- global $wgUser, $wgContLang, $wgOut, $wgMessageCache;
+ global $wgUser, $wgContLang, $wgMessageCache;
wfProfileIn( __METHOD__ );
*/
public function getSection( $text, $section ) {
global $wgParser;
-
return $wgParser->getSection( $text, $section );
}
wfProfileIn( __METHOD__ );
- # Query variables :P
$oldid = $this->getOldID();
- # Pre-fill content with error message so that if something
- # fails we'll have something telling us what we intended.
$this->mOldId = $oldid;
$this->fetchContent( $oldid );
wfRunHooks( 'ArticlePageDataBefore', array( &$this, &$fields ) );
- $row = $dbr->selectRow(
- 'page',
- $fields,
- $conditions,
- __METHOD__
- );
+ $row = $dbr->selectRow( 'page', $fields, $conditions, __METHOD__ );
wfRunHooks( 'ArticlePageDataAfter', array( &$this, &$row ) );
- return $row ;
+ return $row;
}
/**
$lc = LinkCache::singleton();
if ( $data ) {
- $lc->addGoodLinkObj( $data->page_id, $this->mTitle, $data->page_len, $data->page_is_redirect );
+ $lc->addGoodLinkObj( $data->page_id, $this->mTitle, $data->page_len, $data->page_is_redirect, $data->page_latest );
$this->mTitle->mArticleID = intval( $data->page_id );
$this->mIsRedirect = intval( $data->page_is_redirect );
$this->mLatest = intval( $data->page_latest );
} else {
- if ( is_object( $this->mTitle ) ) {
- $lc->addBadLinkObj( $this->mTitle );
- }
+ $lc->addBadLinkObj( $this->mTitle );
$this->mTitle->mArticleID = 0;
}
if ( $oldid ) {
$revision = Revision::newFromId( $oldid );
- if ( is_null( $revision ) ) {
+ if ( $revision === null ) {
wfDebug( __METHOD__ . " failed to retrieve specified revision, id $oldid\n" );
return false;
}
$this->loadPageData( $data );
}
$revision = Revision::newFromId( $this->mLatest );
- if ( is_null( $revision ) ) {
+ if ( $revision === null ) {
wfDebug( __METHOD__ . " failed to retrieve current page, rev_id {$this->mLatest}\n" );
return false;
}
$this->mContentLoaded = true;
$this->mRevision =& $revision;
- wfRunHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) ) ;
+ wfRunHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) );
return $this->mContent;
}
return wfSetVar( $this->mForUpdate, $x );
}
- /**
- * Get the database which should be used for reads
- *
- * @return Database
- * @deprecated - just call wfGetDB( DB_MASTER ) instead
- */
- function getDB() {
- wfDeprecated( __METHOD__ );
- return wfGetDB( DB_MASTER );
- }
-
/**
* Get options for all SELECT statements
*
* @return int Page ID
*/
public function getID() {
- if ( $this->mTitle ) {
- return $this->mTitle->getArticleID();
- } else {
- return 0;
- }
+ return $this->mTitle->getArticleID();
}
/**
*/
public function getUser() {
$this->loadLastEdit();
-
return $this->mUser;
}
*/
public function getUserText() {
$this->loadLastEdit();
-
return $this->mUserText;
}
*/
public function getComment() {
$this->loadLastEdit();
-
return $this->mComment;
}
*/
public function getMinorEdit() {
$this->loadLastEdit();
-
return $this->mMinorEdit;
}
*/
public function getRevIdFetched() {
$this->loadLastEdit();
-
return $this->mRevIdFetched;
}
/**
+ * FIXME: this does what?
* @param $limit Integer: default 0.
* @param $offset Integer: default 0.
* @return UserArrayFromResult object with User objects of article contributors for requested range
* page of the given title.
*/
public function view() {
- global $wgUser, $wgOut, $wgRequest, $wgContLang;
- global $wgEnableParserCache, $wgStylePath, $wgParser;
- global $wgUseTrackbacks, $wgUseFileCache;
+ global $wgUser, $wgOut, $wgRequest, $wgParser;
+ global $wgUseFileCache;
wfProfileIn( __METHOD__ );
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
# If we got diff in the query, we want to see a diff page instead of the article.
- if ( !is_null( $wgRequest->getVal( 'diff' ) ) ) {
+ if ( $wgRequest->getCheck( 'diff' ) ) {
wfDebug( __METHOD__ . ": showing diff page\n" );
$this->showDiffPage();
wfProfileOut( __METHOD__ );
# For the main page, overwrite the <title> element with the con-
# tents of 'pagetitle-view-mainpage' instead of the default (if
# that's not empty).
+ # This message always exists because it is in the i18n files
if ( $this->mTitle->equals( Title::newMainPage() )
&& ( $m = wfMsgForContent( 'pagetitle-view-mainpage' ) ) !== '' )
{
* Article::view() only, other callers should use the DifferenceEngine class.
*/
public function showDiffPage() {
- global $wgOut, $wgRequest, $wgUser;
+ global $wgRequest, $wgUser;
$diff = $wgRequest->getVal( 'diff' );
$rcid = $wgRequest->getVal( 'rcid' );
public function showCssOrJsPage() {
global $wgOut;
- $wgOut->wrapWikiMsg( "<div class='mw-clearyourcache'>\n$1\n</div>", 'clearyourcache' );
+ $wgOut->wrapWikiMsg( "<div id='mw-clearyourcache'>\n$1\n</div>", 'clearyourcache' );
// Give hooks a chance to customise the output
if ( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) {
* Show the footer section of an ordinary page view
*/
public function showViewFooter() {
- global $wgOut, $wgUseTrackbacks, $wgRequest;
+ global $wgOut, $wgUseTrackbacks;
# check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
if ( $this->mTitle->getNamespace() == NS_USER_TALK && IP::isValid( $this->mTitle->getText() ) ) {
$rcid = $wgRequest->getVal( 'rcid' );
- if ( !$rcid || !$this->mTitle->exists() || !$this->mTitle->quickUserCan( 'patrol' ) ) {
+ if ( !$rcid || !$this->mTitle->quickUserCan( 'patrol' ) ) {
return;
}
public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
global $wgOut, $wgContLang, $wgStylePath, $wgUser;
- # Display redirect
if ( !is_array( $target ) ) {
$target = array( $target );
}
$imageDir = $wgContLang->getDir();
- $imageUrl = $wgStylePath . '/common/images/redirect' . $imageDir . '.png';
- $imageUrl2 = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png';
- $alt2 = $wgContLang->isRTL() ? '←' : '→'; // should -> and <- be used instead of Unicode?
if ( $appendSubtitle ) {
$wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
$title = array_shift( $target );
if ( $forceKnown ) {
- $link = $sk->link(
- $title,
- htmlspecialchars( $title->getFullText() ),
- array(),
- array(),
- array( 'known', 'noclasses' )
- );
+ $link = $sk->linkKnown( $title, htmlspecialchars( $title->getFullText() ) );
} else {
$link = $sk->link( $title, htmlspecialchars( $title->getFullText() ) );
}
+ $nextRedirect = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png';
+ $alt = $wgContLang->isRTL() ? '←' : '→';
// Automatically append redirect=no to each link, since most of them are redirect pages themselves.
+ // FIXME: where this happens?
foreach ( $target as $rt ) {
+ $link .= Html::element( 'img', array( 'src' => $nextRedirect, 'alt' => $alt ) );
if ( $forceKnown ) {
- $link .= '<img src="' . $imageUrl2 . '" alt="' . $alt2 . ' " />'
- . $sk->link(
- $rt,
- htmlspecialchars( $rt->getFullText() ),
- array(),
- array(),
- array( 'known', 'noclasses' )
- );
+ $link .= $sk->linkKnown( $rt, htmlspecialchars( $rt->getFullText() ) );
} else {
- $link .= '<img src="' . $imageUrl2 . '" alt="' . $alt2 . ' " />'
- . $sk->link( $rt, htmlspecialchars( $rt->getFullText() ) );
+ $link .= $sk->link( $rt, htmlspecialchars( $rt->getFullText() ) );
}
}
- return '<img src="' . $imageUrl . '" alt="#REDIRECT " />' .
+ $imageUrl = $wgStylePath . '/common/images/redirect' . $imageDir . '.png';
+ return Html::element( 'img', array( 'src' => $imageUrl, 'alt' => '#REDIRECT' ) ) .
'<span class="redirectText">' . $link . '</span>';
}
}
$tbtext .= "\n";
- $tbtext .= wfMsg( strlen( $o->tb_ex ) ? 'trackbackexcerpt' : 'trackback',
+ $tbtext .= wfMsgNoTrans( strlen( $o->tb_ex ) ? 'trackbackexcerpt' : 'trackback',
$o->tb_title,
$o->tb_url,
$o->tb_ex,
global $wgUser, $wgRequest, $wgOut;
if ( $wgUser->isAllowed( 'purge' ) || $wgRequest->wasPosted() ) {
+ //FIXME: shouldn't this be in doPurge()?
if ( wfRunHooks( 'ArticlePurge', array( &$this ) ) ) {
$this->doPurge();
$this->view();
}
} else {
- $action = htmlspecialchars( $wgRequest->getRequestURL() );
- $button = wfMsgExt( 'confirm_purge_button', array( 'escapenoentities' ) );
- $form = "<form method=\"post\" action=\"$action\">\n" .
- "<input type=\"submit\" name=\"submit\" value=\"$button\" />\n" .
- "</form>\n";
- $top = wfMsgExt( 'confirm-purge-top', array( 'parse' ) );
- $bottom = wfMsgExt( 'confirm-purge-bottom', array( 'parse' ) );
+ $formParams = array(
+ 'method' => 'post',
+ 'action' => $wgRequest->getRequestURL(),
+ );
+
+ $wgOut->addWikiMsg( 'confirm-purge-top' );
+
+ $form = Html::openElement( 'form', $formParams );
+ $form .= Xml::submitButton( wfMsg( 'confirm_purge_button' ) );
+ $form .= Html::closeElement( 'form' );
+
+ $wgOut->addHTML( $form );
+ $wgOut->addWikiMsg( 'confirm-purge-bottom' );
+
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
- $wgOut->addHTML( $top . $form . $bottom );
}
}
wfProfileIn( __METHOD__ );
$text = $revision->getText();
- $rt = Title::newFromRedirect( $text );
+ $rt = Title::newFromRedirectRecurse( $text );
$conditions = array( 'page_id' => $this->getId() );
if ( $isRedirect || is_null( $lastRevIsRedirect ) || $lastRevIsRedirect !== $isRedirect ) {
wfProfileIn( __METHOD__ );
if ( $isRedirect ) {
- // This title is a redirect, Add/Update row in the redirect table
- $set = array( /* SET */
- 'rd_namespace' => $redirectTitle->getNamespace(),
- 'rd_title' => $redirectTitle->getDBkey(),
- 'rd_from' => $this->getId(),
- );
- $dbw->replace( 'redirect', array( 'rd_from' ), $set, __METHOD__ );
+ $this->insertRedirectEntry( $redirectTitle );
} else {
// This is not a redirect, remove row from redirect table
$where = array( 'rd_from' => $this->getId() );
}
/**
- * This function is not deprecated until somebody fixes the core not to use
- * it. Nevertheless, use Article::doEdit() instead.
+ * @deprecated use Article::doEdit()
*/
function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC = false, $comment = false, $bot = false ) {
+ wfDeprecated( __METHOD__ );
$flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
( $isminor ? EDIT_MINOR : 0 ) |
( $suppressRC ? EDIT_SUPPRESS_RC : 0 ) |
* @deprecated use Article::doEdit()
*/
function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
+ wfDeprecated( __METHOD__ );
$flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
( $minor ? EDIT_MINOR : 0 ) |
( $forceBot ? EDIT_FORCE_BOT : 0 );
* @param $baseRevId the revision ID this edit was based off, if any
* @param $user Optional user object, $wgUser will be used if not passed
* @param $watchthis Watch the page if true, unwatch the page if false, do nothing if null
+ * @param $comment Boolean: whether the edit is a new section
* @param $sectionanchor The section anchor for the page; used for redirecting the user back to the page
* after the edit is successfully committed
* @param $redirect If true, redirect the user back to the page after the edit is successfully committed
global $wgUser, $wgDBtransactions, $wgUseAutomaticEditSummaries;
# Low-level sanity check
- if ( $this->mTitle->getText() == '' ) {
+ if ( $this->mTitle->getText() === '' ) {
throw new MWException( 'Something is trying to edit an article with an empty title' );
}
* Mark this particular edit/page as patrolled
*/
public function markpatrolled() {
- global $wgOut, $wgRequest, $wgUseRCPatrol, $wgUseNPPatrol, $wgUser;
+ global $wgOut, $wgRequest;
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$returnto = $rc->getAttribute( 'rc_type' ) == RC_NEW ? 'Newpages' : 'Recentchanges';
$return = SpecialPage::getTitleFor( $returnto );
- $dbw = wfGetDB( DB_MASTER );
$errors = $rc->doMarkPatrolled();
if ( in_array( array( 'rcpatroldisabled' ), $errors ) ) {
// If the page has a history, insert a warning
if ( $hasHistory && !$confirm ) {
- global $wgLang;
-
$skin = $wgUser->getSkin();
$revisions = $this->estimateRevisionCount();
+ //FIXME: lego
$wgOut->addHTML( '<strong class="mw-delete-warning-revisions">' .
wfMsgExt( 'historywarning', array( 'parseinline' ), $wgLang->formatNum( $revisions ) ) .
wfMsgHtml( 'word-separator' ) . $skin->historyLink() .
);
if ( $bigHistory ) {
- global $wgDeleteRevisionsLimit;
-
$wgOut->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n",
array( 'delete-warning-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) );
}
/**
* Output deletion confirmation dialog
+ * FIXME: Move to another file?
* @param $reason String: prefilled reason
*/
public function confirmDelete( $reason ) {
wfDebug( "Article::confirmDelete\n" );
- $deleteBackLink = $wgUser->getSkin()->link(
- $this->mTitle,
- null,
- array(),
- array(),
- array( 'known', 'noclasses' )
- );
+ $deleteBackLink = $wgUser->getSkin()->linkKnown( $this->mTitle );
$wgOut->setSubtitle( wfMsgHtml( 'delete-backlink', $deleteBackLink ) );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->addWikiMsg( 'confirmdeletetext' );
$wgOut->addHTML( $form );
$wgOut->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
- LogEventsList::showLogExtract(
- $wgOut,
- 'delete',
+ LogEventsList::showLogExtract( $wgOut, 'delete',
$this->mTitle->getPrefixedText()
);
}
* @return boolean true if successful
*/
public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true ) {
- global $wgUseSquid, $wgDeferredUpdateList;
- global $wgUseTrackbacks;
+ global $wgDeferredUpdateList, $wgUseTrackbacks;
wfDebug( __METHOD__ . "\n" );
$t = $this->mTitle->getDBkey();
$id = $id ? $id : $this->mTitle->getArticleID( GAID_FOR_UPDATE );
- if ( $t == '' || $id == 0 ) {
+ if ( $t === '' || $id == 0 ) {
return false;
}
* User interface for rollback operations
*/
public function rollback() {
- global $wgUser, $wgOut, $wgRequest, $wgUseRCPatrol;
+ global $wgUser, $wgOut, $wgRequest;
$details = null;
* @return string containing GMT timestamp
*/
public function getTouched() {
- # Ensure that page data has been loaded
if ( !$this->mDataLoaded ) {
$this->loadPageData();
}
$revision->insertOn( $dbw );
$this->updateRevisionOn( $dbw, $revision );
+ global $wgUser;
wfRunHooks( 'NewRevisionFromEditComplete', array( $this, $revision, false, $wgUser ) );
wfProfileOut( __METHOD__ );
$pageTable = $dbw->tableName( 'page' );
$hitcounterTable = $dbw->tableName( 'hitcounter' );
$acchitsTable = $dbw->tableName( 'acchits' );
+ $dbType = $dbw->getType();
- if ( $wgHitcounterUpdateFreq <= 1 ) {
+ if ( $wgHitcounterUpdateFreq <= 1 || $dbType == 'sqlite' ) {
$dbw->query( "UPDATE $pageTable SET page_counter = page_counter + 1 WHERE page_id = $id" );
return;
wfProfileIn( 'Article::incViewCount-collect' );
$old_user_abort = ignore_user_abort( true );
- $dbType = $dbw->getType();
$dbw->lockTables( array(), array( 'hitcounter' ), __METHOD__, false );
$tabletype = $dbType == 'mysql' ? "ENGINE=HEAP " : '';
$dbw->query( "CREATE TEMPORARY TABLE $acchitsTable $tabletype AS " .
*/
public function revert() {
global $wgOut;
-
$wgOut->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
$pageInfo = $this->pageCountInfo( $page );
$talkInfo = $this->pageCountInfo( $page->getTalkPage() );
+
+ //FIXME: unescaped messages
$wgOut->addHTML( "<ul><li>" . wfMsg( "numwatchers", $wgLang->formatNum( $numwatchers ) ) . '</li>' );
$wgOut->addHTML( "<li>" . wfMsg( 'numedits', $wgLang->formatNum( $pageInfo['edits'] ) ) . '</li>' );
* @return string An appropriate autosummary, or an empty string.
*/
public static function getAutosummary( $oldtext, $newtext, $flags ) {
+ global $wgContLang;
+
# Decide what kind of autosummary is needed.
# Redirect autosummaries
# New page autosummaries
if ( $flags & EDIT_NEW && strlen( $newtext ) ) {
# If they're making a new article, give its text, truncated, in the summary.
- global $wgContLang;
$truncatedtext = $wgContLang->truncate(
str_replace( "\n", ' ', $newtext ),
return wfMsgForContent( 'autosumm-blank' );
} elseif ( strlen( $oldtext ) > 10 * strlen( $newtext ) && strlen( $newtext ) < 500 ) {
# Removing more than 90% of the article
- global $wgContLang;
$truncatedtext = $wgContLang->truncate(
$newtext,
* @return string containing parsed output
*/
public function getOutputFromWikitext( $text, $cache = true, $parserOptions = false ) {
- global $wgParser, $wgOut, $wgEnableParserCache, $wgUseFileCache;
+ global $wgParser, $wgEnableParserCache, $wgUseFileCache;
if ( !$parserOptions ) {
$parserOptions = $this->getParserOptions();
$this->mTitle->getPrefixedDBkey() ) );
}
- if ( $wgEnableParserCache && $cache && $this && !$this->mParserOutput->isCacheable() ) {
+ if ( $wgEnableParserCache && $cache && $this->mParserOutput->isCacheable() ) {
$parserCache = ParserCache::singleton();
$parserCache->save( $this->mParserOutput, $this, $parserOptions );
}
__METHOD__
);
- global $wgContLang;
-
foreach ( $res as $row ) {
$tlTemplates["{$row->tl_namespace}:{$row->tl_title}"] = true;
}
* @param $oldid mixed integer Revision ID or null
*/
public function getParserOutput( $oldid = null ) {
- global $wgEnableParserCache, $wgUser, $wgOut;
+ global $wgEnableParserCache, $wgUser;
// Should the parser cache be used?
$useParserCache = $wgEnableParserCache &&
return $parserOutput;
}
}
+
+ // Deprecated methods
+ /**
+ * Get the database which should be used for reads
+ *
+ * @return Database
+ * @deprecated - just call wfGetDB( DB_MASTER ) instead
+ */
+ function getDB() {
+ wfDeprecated( __METHOD__ );
+ return wfGetDB( DB_MASTER );
+ }
+
}