Merge "Added new MWTimestamp::getRelativeTimestamp for pure relative."
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index 3eb83e3..bde508a 100644 (file)
@@ -280,9 +280,17 @@ class ParserOptions {
        }
 
        /**
+        * Get the user language used by the parser for this page.
+        *
         * You shouldn't use this. Really. $parser->getFunctionLang() is all you need.
-        * Using this fragments the cache and is discouraged. Yes, {{int: }} uses this,
-        * producing inconsistent tables (Bug 14404).
+        *
+        * To avoid side-effects where the page will be rendered based on the language
+        * of the user who last saved, this function will triger a cache fragmentation.
+        * Usage of this method is discouraged for that reason.
+        *
+        * When saving, this will return the default language instead of the user's.
+        *
+        * {{int: }} uses this which used to produce inconsistent link tables (bug 14404).
         *
         * @return Language object
         * @since 1.19
@@ -312,7 +320,7 @@ class ParserOptions {
        function setAllowSpecialInclusion( $x )     { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
        function setTidy( $x )                      { return wfSetVar( $this->mTidy, $x ); }
 
-       /** @deprecated in 1.19; will be removed in 1.20 */
+       /** @deprecated in 1.19 */
        function setSkin( $x )                      { wfDeprecated( __METHOD__, '1.19' ); }
        function setInterfaceMessage( $x )          { return wfSetVar( $this->mInterfaceMessage, $x ); }
        function setTargetLanguage( $x )            { return wfSetVar( $this->mTargetLanguage, $x, true ); }
@@ -538,7 +546,7 @@ class ParserOptions {
 
                // add in language specific options, if any
                // @todo FIXME: This is just a way of retrieving the url/user preferred variant
-               if( !is_null( $title ) ) {
+               if ( !is_null( $title ) ) {
                        $confstr .= $title->getPageLanguage()->getExtraHashOptions();
                } else {
                        global $wgContLang;
@@ -557,8 +565,9 @@ class ParserOptions {
                        $confstr .= '!printable=1';
                }
 
-               if ( $this->mExtraKey != '' )
+               if ( $this->mExtraKey != '' ) {
                        $confstr .= $this->mExtraKey;
+               }
 
                // Give a chance for extensions to modify the hash, if they have
                // extra options or other effects on the parser cache.