r78203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78202‎ | r78203 | r78204 >
Date:18:48, 10 December 2010
Author:ialex
Status:ok
Tags:
Comment:
Moved constant values from constructor to class definition
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -89,10 +89,20 @@
9090 const MARKER_SUFFIX = "-QINU\x7f";
9191
9292 # Persistent:
93 - var $mTagHooks, $mTransparentTagHooks, $mFunctionHooks, $mFunctionSynonyms, $mVariables;
94 - var $mSubstWords, $mImageParams, $mImageParamsMagicArray, $mStripList, $mMarkerIndex;
95 - var $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols, $mDefaultStripList;
96 - var $mVarCache, $mConf, $mFunctionTagHooks;
 93+ var $mTagHooks = array();
 94+ var $mTransparentTagHooks = array();
 95+ var $mFunctionHooks = array();
 96+ var $mFunctionSynonyms = array( 0 => array(), 1 => array() );
 97+ var $mFunctionTagHooks = array();
 98+ var $mStripList = array();
 99+ var $mDefaultStripList = array();
 100+ var $mVarCache = array();
 101+ var $mImageParams = array();
 102+ var $mImageParamsMagicArray = array();
 103+ var $mMarkerIndex = 0;
 104+ var $mFirstCall = true;
 105+ var $mVariables, $mSubstWords; # Initialised by initialiseVariables()
 106+ var $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor
97107
98108
99109 # Cleared with clearState():
@@ -124,16 +134,9 @@
125135 */
126136 function __construct( $conf = array() ) {
127137 $this->mConf = $conf;
128 - $this->mTagHooks = array();
129 - $this->mTransparentTagHooks = array();
130 - $this->mFunctionHooks = array();
131 - $this->mFunctionTagHooks = array();
132 - $this->mFunctionSynonyms = array( 0 => array(), 1 => array() );
133 - $this->mDefaultStripList = $this->mStripList = array();
134138 $this->mUrlProtocols = wfUrlProtocols();
135139 $this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'.
136140 '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/S';
137 - $this->mVarCache = array();
138141 if ( isset( $conf['preprocessorClass'] ) ) {
139142 $this->mPreprocessorClass = $conf['preprocessorClass'];
140143 } elseif ( extension_loaded( 'domxml' ) ) {
@@ -145,8 +148,6 @@
146149 } else {
147150 $this->mPreprocessorClass = 'Preprocessor_Hash';
148151 }
149 - $this->mMarkerIndex = 0;
150 - $this->mFirstCall = true;
151152 }
152153
153154 /**

Status & tagging log