/** * Should the parser cache be used? * * @param $user User The relevant user * @return boolean */ public function isParserCacheUsed(User $user, $oldid) { global $wgEnableParserCache; return $wgEnableParserCache && $user->getStubThreshold() == 0 && $this->exists() && empty($oldid) && !$this->mTitle->isCssOrJsPage() && !$this->mTitle->isCssJsSubpage(); }
/** * Get user options * * @param User $user * @param Language $lang */ private function initialiseFromUser($user, $lang) { global $wgInterwikiMagic, $wgAllowExternalImages, $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize, $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit, $wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion; // *UPDATE* ParserOptions::matches() if any of this changes as needed $this->mInterwikiMagic = $wgInterwikiMagic; $this->mAllowExternalImages = $wgAllowExternalImages; $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom; $this->mEnableImageWhitelist = $wgEnableImageWhitelist; $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion; $this->mMaxIncludeSize = $wgMaxArticleSize * 1024; $this->mMaxPPNodeCount = $wgMaxPPNodeCount; $this->mMaxGeneratedPPNodeCount = $wgMaxGeneratedPPNodeCount; $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth; $this->mMaxTemplateDepth = $wgMaxTemplateDepth; $this->mExpensiveParserFunctionLimit = $wgExpensiveParserFunctionLimit; $this->mCleanSignatures = $wgCleanSignatures; $this->mExternalLinkTarget = $wgExternalLinkTarget; $this->mDisableContentConversion = $wgDisableLangConversion; $this->mDisableTitleConversion = $wgDisableLangConversion || $wgDisableTitleConversion; $this->mUser = $user; $this->mNumberHeadings = $user->getOption('numberheadings'); $this->mThumbSize = $user->getOption('thumbsize'); $this->mStubThreshold = $user->getStubThreshold(); $this->mUserLang = $lang; }
/** Get user options */ function initialiseFromUser($userInput) { global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages; global $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize; global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures; global $wgExternalLinkTarget, $wgLang; wfProfileIn(__METHOD__); if (!$userInput) { global $wgUser; if (isset($wgUser)) { $user = $wgUser; } else { $user = new User(); } } else { $user =& $userInput; } $this->mUser = $user; $this->mUseDynamicDates = $wgUseDynamicDates; $this->mInterwikiMagic = $wgInterwikiMagic; $this->mAllowExternalImages = $wgAllowExternalImages; $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom; $this->mEnableImageWhitelist = $wgEnableImageWhitelist; $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion; $this->mMaxIncludeSize = $wgMaxArticleSize * 1024; $this->mMaxPPNodeCount = $wgMaxPPNodeCount; $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth; $this->mMaxTemplateDepth = $wgMaxTemplateDepth; $this->mCleanSignatures = $wgCleanSignatures; $this->mExternalLinkTarget = $wgExternalLinkTarget; $this->mNumberHeadings = $user->getOption('numberheadings'); $this->mMath = $user->getOption('math'); $this->mThumbSize = $user->getOption('thumbsize'); $this->mStubThreshold = $user->getStubThreshold(); $this->mUserLang = $wgLang->getCode(); wfProfileOut(__METHOD__); }