Esempio n. 1
0
 /**
  * Clear Parser state
  *
  * @private
  */
 function clearState()
 {
     wfProfileIn(__METHOD__);
     if ($this->mFirstCall) {
         $this->firstCallInit();
     }
     $this->mOutput = new ParserOutput();
     $this->mOptions->registerWatcher(array($this->mOutput, 'recordOption'));
     $this->mAutonumber = 0;
     $this->mLastSection = '';
     $this->mDTopen = false;
     $this->mIncludeCount = array();
     $this->mArgStack = false;
     $this->mInPre = false;
     $this->mLinkHolders = new LinkHolderArray($this);
     $this->mLinkID = 0;
     $this->mRevisionObject = $this->mRevisionTimestamp = $this->mRevisionId = $this->mRevisionUser = $this->mRevisionSize = null;
     $this->mVarCache = array();
     $this->mUser = null;
     $this->mLangLinkLanguages = array();
     /**
      * Prefix for temporary replacement strings for the multipass parser.
      * \x07 should never appear in input as it's disallowed in XML.
      * Using it at the front also gives us a little extra robustness
      * since it shouldn't match when butted up against identifier-like
      * string constructs.
      *
      * Must not consist of all title characters, or else it will change
      * the behavior of <nowiki> in a link.
      */
     $this->mUniqPrefix = "UNIQ" . self::getRandomString();
     $this->mStripState = new StripState($this->mUniqPrefix);
     # Clear these on every parse, bug 4549
     $this->mTplExpandCache = $this->mTplRedirCache = $this->mTplDomCache = array();
     $this->mShowToc = true;
     $this->mForceTocPosition = false;
     $this->mIncludeSizes = array('post-expand' => 0, 'arg' => 0);
     $this->mPPNodeCount = 0;
     $this->mGeneratedPPNodeCount = 0;
     $this->mHighestExpansionDepth = 0;
     $this->mDefaultSort = false;
     $this->mHeadings = array();
     $this->mDoubleUnderscores = array();
     $this->mExpensiveFunctionCount = 0;
     # Fix cloning
     if (isset($this->mPreprocessor) && $this->mPreprocessor->parser !== $this) {
         $this->mPreprocessor = null;
     }
     wfRunHooks('ParserClearState', array(&$this));
     wfProfileOut(__METHOD__);
 }
Esempio n. 2
0
 /**
  * Clear Parser state
  *
  * @private
  */
 public function clearState()
 {
     if ($this->mFirstCall) {
         $this->firstCallInit();
     }
     $this->mOutput = new ParserOutput();
     $this->mOptions->registerWatcher(array($this->mOutput, 'recordOption'));
     $this->mAutonumber = 0;
     $this->mLastSection = '';
     $this->mDTopen = false;
     $this->mIncludeCount = array();
     $this->mArgStack = false;
     $this->mInPre = false;
     $this->mLinkHolders = new LinkHolderArray($this);
     $this->mLinkID = 0;
     $this->mRevisionObject = $this->mRevisionTimestamp = $this->mRevisionId = $this->mRevisionUser = $this->mRevisionSize = null;
     $this->mVarCache = array();
     $this->mUser = null;
     $this->mLangLinkLanguages = array();
     $this->currentRevisionCache = null;
     $this->mStripState = new StripState();
     # Clear these on every parse, bug 4549
     $this->mTplRedirCache = $this->mTplDomCache = array();
     $this->mShowToc = true;
     $this->mForceTocPosition = false;
     $this->mIncludeSizes = array('post-expand' => 0, 'arg' => 0);
     $this->mPPNodeCount = 0;
     $this->mGeneratedPPNodeCount = 0;
     $this->mHighestExpansionDepth = 0;
     $this->mDefaultSort = false;
     $this->mHeadings = array();
     $this->mDoubleUnderscores = array();
     $this->mExpensiveFunctionCount = 0;
     # Fix cloning
     if (isset($this->mPreprocessor) && $this->mPreprocessor->parser !== $this) {
         $this->mPreprocessor = null;
     }
     $this->mProfiler = new SectionProfiler();
     Hooks::run('ParserClearState', array(&$this));
 }