From: Platonides Date: Thu, 5 Aug 2010 19:01:47 +0000 (+0000) Subject: Use ParserOptions accessors. X-Git-Tag: 1.31.0-rc.0~35695 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=9c143c5900f61a0ce293a6ef6b45385266710b5b;p=lhc%2Fweb%2Fwiklou.git Use ParserOptions accessors. Only one direct usage remains, in ParserCache::getKey, which will be rewritten. --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 5eb2b6c855..610ebecf54 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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; diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 4f2e5f15a1..0ec99c5f38 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -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; } diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 7640ce79e4..c13b033d96 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -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 'Node-count limit exceeded'; } - if ( $expansionDepth > $this->parser->mOptions->mMaxPPExpandDepth ) { + if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) { return 'Expansion depth limit exceeded'; } wfProfileIn( __METHOD__ ); diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index ba9bc75c0c..5f536debda 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -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 'Node-count limit exceeded'; } - if ( $expansionDepth > $this->parser->mOptions->mMaxPPExpandDepth ) { + if ( $expansionDepth > $this->parser->mOptions->getMaxPPExpandDepth() ) { return 'Expansion depth limit exceeded'; } ++$expansionDepth;