From 669ecd8a94818331c355adf9a864442fd663545d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 29 Sep 2011 17:51:27 +0000 Subject: [PATCH] Moved getParserOptions() crap back to Article.php due to $wgUser dependency. Callers updated. --- includes/Article.php | 21 +++++++++++++++++---- includes/WikiPage.php | 13 ------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 8f69a4cfa2..95c476fc13 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -382,7 +382,7 @@ class Article extends Page { $parserCache = ParserCache::singleton(); - $parserOptions = $this->mPage->getParserOptions(); + $parserOptions = $this->getParserOptions(); # Render printable version, use printable version cache if ( $wgOut->isPrintable() ) { $parserOptions->setIsPrintable( true ); @@ -1004,7 +1004,7 @@ class Article extends Page { global $wgOut; $oldid = $this->getOldID(); - $parserOptions = $this->mPage->getParserOptions(); + $parserOptions = $this->getParserOptions(); # Render printable version, use printable version cache $parserOptions->setIsPrintable( $wgOut->isPrintable() ); @@ -1031,7 +1031,7 @@ class Article extends Page { public function tryDirtyCache() { global $wgOut; $parserCache = ParserCache::singleton(); - $options = $this->mPage->getParserOptions(); + $options = $this->getParserOptions(); if ( $wgOut->isPrintable() ) { $options->setIsPrintable( true ); @@ -1839,7 +1839,7 @@ class Article extends Page { global $wgParser, $wgEnableParserCache, $wgUseFileCache; if ( !$parserOptions ) { - $parserOptions = $this->mPage->getParserOptions(); + $parserOptions = $this->getParserOptions(); } $time = - wfTime(); @@ -1872,6 +1872,19 @@ class Article extends Page { return $this->mParserOutput; } + /** + * Get parser options suitable for rendering the primary article wikitext + * @return mixed ParserOptions object or boolean false + */ + public function getParserOptions() { + global $wgUser; + if ( !$this->mParserOptions ) { + $this->mParserOptions = $this->mPage->makeParserOptions( $wgUser ); + } + // Clone to allow modifications of the return value without affecting cache + return clone $this->mParserOptions; + } + /** * Sets the context this Article is executed in * diff --git a/includes/WikiPage.php b/includes/WikiPage.php index d1ce051c81..11658c0691 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -2558,19 +2558,6 @@ class WikiPage extends Page { return $reason; } - /** - * Get parser options suitable for rendering the primary article wikitext - * @return mixed ParserOptions object or boolean false - */ - public function getParserOptions() { - global $wgUser; - if ( !$this->mParserOptions ) { - $this->mParserOptions = $this->makeParserOptions( $wgUser ); - } - // Clone to allow modifications of the return value without affecting cache - return clone $this->mParserOptions; - } - /** * Get parser options suitable for rendering the primary article wikitext * @param User|string $user User object or 'canonical' -- 2.20.1