Merge "API: Clean up skin handling"
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index 2ca9d50..b570fa5 100644 (file)
@@ -116,6 +116,12 @@ class ParserOptions {
         */
        public $mRemoveComments = true;
 
+       /**
+        * Callback for current revision fetching. Used as first argument to call_user_func().
+        */
+       public $mCurrentRevisionCallback =
+               array( 'Parser', 'statelessFetchRevision' );
+
        /**
         * Callback for template fetching. Used as first argument to call_user_func().
         */
@@ -211,6 +217,13 @@ class ParserOptions {
         */
        protected $onAccessCallback = null;
 
+       /**
+        * If the page being parsed is a redirect, this should hold the redirect
+        * target.
+        * @var Title|null
+        */
+       private $redirectTarget = null;
+
        public function getInterwikiMagic() {
                return $this->mInterwikiMagic;
        }
@@ -282,6 +295,11 @@ class ParserOptions {
                return $this->mRemoveComments;
        }
 
+       /* @since 1.24 */
+       public function getCurrentRevisionCallback() {
+               return $this->mCurrentRevisionCallback;
+       }
+
        public function getTemplateCallback() {
                return $this->mTemplateCallback;
        }
@@ -455,6 +473,11 @@ class ParserOptions {
                return wfSetVar( $this->mRemoveComments, $x );
        }
 
+       /* @since 1.24 */
+       public function setCurrentRevisionCallback( $x ) {
+               return wfSetVar( $this->mCurrentRevisionCallback, $x );
+       }
+
        public function setTemplateCallback( $x ) {
                return wfSetVar( $this->mTemplateCallback, $x );
        }
@@ -515,6 +538,30 @@ class ParserOptions {
                return wfSetVar( $this->mIsPrintable, $x );
        }
 
+       /**
+        * Set the redirect target.
+        *
+        * Note that setting or changing this does not *make* the page a redirect
+        * or change its target, it merely records the information for reference
+        * during the parse.
+        *
+        * @since 1.24
+        * @param Title|null $title
+        */
+       function setRedirectTarget( $title ) {
+               $this->redirectTarget = $title;
+       }
+
+       /**
+        * Get the previously-set redirect target.
+        *
+        * @since 1.24
+        * @return Title|null
+        */
+       function getRedirectTarget() {
+               return $this->redirectTarget;
+       }
+
        /**
         * Extra key that should be present in the parser cache key.
         * @param string $key