More function and variable documentation
[lhc/web/wiklou.git] / includes / parser / Parser.php
index b7c63bf..ad22310 100644 (file)
@@ -119,7 +119,11 @@ class Parser {
 
        # Temporary
        # These are variables reset at least once per parse regardless of $clearState
-       var $mOptions;      # ParserOptions object
+
+       /**
+        * @var ParserOptions
+        */
+       var $mOptions;
        var $mTitle;        # Title context, used for self-link rendering and similar things
        var $mOutputType;   # Output type, one of the OT_xxx constants
        var $ot;            # Shortcut alias, see setOutputType()
@@ -614,6 +618,9 @@ class Parser {
                return $this->mLinkID++;
        }
 
+       /**
+        * @return Language
+        */
        function getFunctionLang() {
                global $wgLang, $wgContLang;
 
@@ -2448,6 +2455,7 @@ class Parser {
                }
                if ( $stack > 0 ) {
                        wfDebug( __METHOD__.": Invalid input; not enough close tags (stack $stack, state $state)\n" );
+                       wfProfileOut( __METHOD__ );
                        return false;
                }
                wfProfileOut( __METHOD__ );
@@ -4269,10 +4277,10 @@ class Parser {
         *
         * @param $text String: the text to preprocess
         * @param $options ParserOptions: options
+        * @param $title Title object or null to use $wgTitle
         * @return String
         */
-       public function transformMsg( $text, $options ) {
-               global $wgTitle;
+       public function transformMsg( $text, $options, $title = null ) {
                static $executing = false;
 
                # Guard against infinite recursion
@@ -4282,7 +4290,10 @@ class Parser {
                $executing = true;
 
                wfProfileIn( __METHOD__ );
-               $title = $wgTitle;
+               if ( !$title ) {
+                       global $wgTitle;
+                       $title = $wgTitle;
+               }
                if ( !$title ) {
                        # It's not uncommon having a null $wgTitle in scripts. See r80898
                        # Create a ghost title in such case