r98421 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98420‎ | r98421 | r98422 >
Date:17:51, 29 September 2011
Author:aaron
Status:resolved
Tags:
Comment:
Moved getParserOptions() crap back to Article.php due to $wgUser dependency. Callers updated.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -382,7 +382,7 @@
383383
384384 $parserCache = ParserCache::singleton();
385385
386 - $parserOptions = $this->mPage->getParserOptions();
 386+ $parserOptions = $this->getParserOptions();
387387 # Render printable version, use printable version cache
388388 if ( $wgOut->isPrintable() ) {
389389 $parserOptions->setIsPrintable( true );
@@ -1004,7 +1004,7 @@
10051005 global $wgOut;
10061006
10071007 $oldid = $this->getOldID();
1008 - $parserOptions = $this->mPage->getParserOptions();
 1008+ $parserOptions = $this->getParserOptions();
10091009
10101010 # Render printable version, use printable version cache
10111011 $parserOptions->setIsPrintable( $wgOut->isPrintable() );
@@ -1031,7 +1031,7 @@
10321032 public function tryDirtyCache() {
10331033 global $wgOut;
10341034 $parserCache = ParserCache::singleton();
1035 - $options = $this->mPage->getParserOptions();
 1035+ $options = $this->getParserOptions();
10361036
10371037 if ( $wgOut->isPrintable() ) {
10381038 $options->setIsPrintable( true );
@@ -1839,7 +1839,7 @@
18401840 global $wgParser, $wgEnableParserCache, $wgUseFileCache;
18411841
18421842 if ( !$parserOptions ) {
1843 - $parserOptions = $this->mPage->getParserOptions();
 1843+ $parserOptions = $this->getParserOptions();
18441844 }
18451845
18461846 $time = - wfTime();
@@ -1873,6 +1873,19 @@
18741874 }
18751875
18761876 /**
 1877+ * Get parser options suitable for rendering the primary article wikitext
 1878+ * @return mixed ParserOptions object or boolean false
 1879+ */
 1880+ public function getParserOptions() {
 1881+ global $wgUser;
 1882+ if ( !$this->mParserOptions ) {
 1883+ $this->mParserOptions = $this->mPage->makeParserOptions( $wgUser );
 1884+ }
 1885+ // Clone to allow modifications of the return value without affecting cache
 1886+ return clone $this->mParserOptions;
 1887+ }
 1888+
 1889+ /**
18771890 * Sets the context this Article is executed in
18781891 *
18791892 * @param $context IContextSource
Index: trunk/phase3/includes/WikiPage.php
@@ -2559,19 +2559,6 @@
25602560 }
25612561
25622562 /**
2563 - * Get parser options suitable for rendering the primary article wikitext
2564 - * @return mixed ParserOptions object or boolean false
2565 - */
2566 - public function getParserOptions() {
2567 - global $wgUser;
2568 - if ( !$this->mParserOptions ) {
2569 - $this->mParserOptions = $this->makeParserOptions( $wgUser );
2570 - }
2571 - // Clone to allow modifications of the return value without affecting cache
2572 - return clone $this->mParserOptions;
2573 - }
2574 -
2575 - /**
25762563 * Get parser options suitable for rendering the primary article wikitext
25772564 * @param User|string $user User object or 'canonical'
25782565 * @return ParserOptions

Follow-up revisions

RevisionCommit summaryAuthorDate
r98423FU r98421: forgot to move mParserOptions fieldaaron17:54, 29 September 2011

Status & tagging log