Moved getParserOptions() crap back to Article.php due to $wgUser dependency. Callers...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 29 Sep 2011 17:51:27 +0000 (17:51 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 29 Sep 2011 17:51:27 +0000 (17:51 +0000)
includes/Article.php
includes/WikiPage.php

index 8f69a4c..95c476f 100644 (file)
@@ -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
         *
index d1ce051..11658c0 100644 (file)
@@ -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'