Use ParserOptions accessors.
authorPlatonides <platonides@users.mediawiki.org>
Thu, 5 Aug 2010 19:01:47 +0000 (19:01 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Thu, 5 Aug 2010 19:01:47 +0000 (19:01 +0000)
Only one direct usage remains, in ParserCache::getKey, which will be rewritten.

includes/parser/Parser.php
includes/parser/ParserOptions.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php

index 5eb2b6c..610ebec 100644 (file)
@@ -369,7 +369,7 @@ class Parser {
 
                $text = Sanitizer::normalizeCharReferences( $text );
 
-               if ( ( $wgUseTidy && $this->mOptions->mTidy ) || $wgAlwaysUseTidy ) {
+               if ( ( $wgUseTidy && $this->mOptions->getTidy() ) || $wgAlwaysUseTidy ) {
                        $text = MWTidy::tidy( $text );
                } else {
                        # attempt to sanitize at least some nesting problems
@@ -411,7 +411,7 @@ class Parser {
                        $PFreport = "Expensive parser function count: {$this->mExpensiveFunctionCount}/$wgExpensiveParserFunctionLimit\n";
                        $limitReport =
                                "NewPP limit report\n" .
-                               "Preprocessor node count: {$this->mPPNodeCount}/{$this->mOptions->mMaxPPNodeCount}\n" .
+                               "Preprocessor node count: {$this->mPPNodeCount}/{$this->mOptions->getMaxPPNodeCount()}\n" .
                                "Post-expand include size: {$this->mIncludeSizes['post-expand']}/$max bytes\n" .
                                "Template argument size: {$this->mIncludeSizes['arg']}/$max bytes\n".
                                $PFreport;
index 4f2e5f1..0ec99c5 100644 (file)
@@ -50,6 +50,7 @@ class ParserOptions {
        function getTargetLanguage()                { return $this->mTargetLanguage; }
        function getMaxIncludeSize()                { return $this->mMaxIncludeSize; }
        function getMaxPPNodeCount()                { return $this->mMaxPPNodeCount; }
+       function getMaxPPExpandDepth()              { return $this->mMaxPPExpandDepth; }
        function getMaxTemplateDepth()              { return $this->mMaxTemplateDepth; }
        function getRemoveComments()                { return $this->mRemoveComments; }
        function getTemplateCallback()              { return $this->mTemplateCallback; }
index 7640ce7..c13b033 100644 (file)
@@ -901,12 +901,12 @@ class PPFrame_DOM implements PPFrame {
                        return $root;
                }
 
-               if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->mMaxPPNodeCount )
+               if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() )
                {
                        return '<span class="error">Node-count limit exceeded</span>';
                }
 
-               if ( $expansionDepth > $this->parser->mOptions->mMaxPPExpandDepth ) {
+               if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) {
                        return '<span class="error">Expansion depth limit exceeded</span>';
                }
                wfProfileIn( __METHOD__ );
index ba9bc75..5f536de 100644 (file)
@@ -882,11 +882,11 @@ class PPFrame_Hash implements PPFrame {
                        return $root;
                }
 
-               if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->mMaxPPNodeCount )
+               if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() )
                {
                        return '<span class="error">Node-count limit exceeded</span>';
                }
-               if ( $expansionDepth > $this->parser->mOptions->mMaxPPExpandDepth ) {
+               if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) {
                        return '<span class="error">Expansion depth limit exceeded</span>';
                }
                ++$expansionDepth;