* See design.txt for an overview.
* Note: edit user interface and cache support functions have been
* moved to separate EditPage and HTMLFileCache classes.
- *
- * @internal documentation reviewed 15 Mar 2010
*/
class Article implements Page {
/** @var IContextSource The context this Article is executed in */
$useParserCache = $this->mPage->isParserCacheUsed( $parserOptions, $oldid );
wfDebug( 'Article::view using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
if ( $user->getStubThreshold() ) {
- wfIncrStats( 'pcache_miss_stub' );
+ $this->getContext()->getStats()->increment( 'pcache_miss_stub' );
}
$this->showRedirectedFromHeader();
}
# Get the ParserOutput actually *displayed* here.
- # Note that $this->mParserOutput is the *current* version output.
+ # Note that $this->mParserOutput is the *current*/oldid version output.
$pOutput = ( $outputDone instanceof ParserOutput )
? $outputDone // object fetched by hook
: $this->mParserOutput;
* Show a diff page according to current request variables. For use within
* Article::view() only, other callers should use the DifferenceEngine class.
*
- * @todo Make protected
*/
- public function showDiffPage() {
+ protected function showDiffPage() {
$request = $this->getContext()->getRequest();
$user = $this->getContext()->getUser();
$diff = $request->getVal( 'diff' );
*/
public function showRedirectedFromHeader() {
global $wgRedirectSources;
- $outputPage = $this->getContext()->getOutput();
- $request = $this->getContext()->getRequest();
+ $context = $this->getContext();
+ $outputPage = $context->getOutput();
+ $request = $context->getRequest();
$rdfrom = $request->getVal( 'rdfrom' );
// Construct a URL for the current page view, but with the target title
);
$outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
- wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
+ $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse()
. "</span>" );
// Add the script to update the displayed URL and
if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
$redir = Linker::makeExternalLink( $rdfrom, $rdfrom );
$outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
- wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
+ $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse()
. "</span>" );
// Add the script to update the displayed URL
}
$html .= '</ul>';
- $redirectToText = wfMessage( 'redirectto' )->inLanguage( $lang )->text();
+ $redirectToText = wfMessage( 'redirectto' )->inLanguage( $lang )->escaped();
return '<div class="redirectMsg">' .
'<p>' . $redirectToText . '</p>' .
$context->msg( 'historywarning' )->numParams( $revisions )->parse() .
$context->msg( 'word-separator' )->escaped() . Linker::linkKnown( $title,
$context->msg( 'history' )->escaped(),
- array( 'rel' => 'archives' ),
+ array(),
array( 'action' => 'history' ) ) .
'</strong>'
);