section */ public $mHeadItems = []; /** * @var array $mModules Modules to be loaded by ResourceLoader */ public $mModules = []; /** * @var array $mModuleScripts Modules of which only the JS will be loaded by ResourceLoader. */ public $mModuleScripts = []; /** * @var array $mModuleStyles Modules of which only the CSSS will be loaded by ResourceLoader. */ public $mModuleStyles = []; /** * @var array $mJsConfigVars JavaScript config variable for mw.config combined with this page. */ public $mJsConfigVars = []; /** * @var array $mOutputHooks Hook tags as per $wgParserOutputHooks. */ public $mOutputHooks = []; /** * @var array $mWarnings Warning text to be returned to the user. * Wikitext formatted, in the key only. */ public $mWarnings = []; /** * @var array $mSections Table of contents */ public $mSections = []; /** * @var array $mProperties Name/value pairs to be cached in the DB. */ public $mProperties = []; /** * @var string $mTOCHTML HTML of the TOC. */ public $mTOCHTML = ''; /** * @var string $mTimestamp Timestamp of the revision. */ public $mTimestamp; /** * @var bool $mEnableOOUI Whether OOUI should be enabled. */ public $mEnableOOUI = false; /** * @var string $mIndexPolicy 'index' or 'noindex'? Any other value will result in no change. */ private $mIndexPolicy = ''; /** * @var array $mAccessedOptions List of ParserOptions (stored in the keys). */ private $mAccessedOptions = []; /** * @var array $mExtensionData extra data used by extensions. */ private $mExtensionData = []; /** * @var array $mLimitReportData Parser limit report data. */ private $mLimitReportData = []; /** @var array Parser limit report data for JSON */ private $mLimitReportJSData = []; /** * @var array $mParseStartTime Timestamps for getTimeSinceStart(). */ private $mParseStartTime = []; /** * @var bool $mPreventClickjacking Whether to emit X-Frame-Options: DENY. */ private $mPreventClickjacking = false; /** * @var array $mFlags Generic flags. */ private $mFlags = []; /** @var int|null Assumed rev ID for {{REVISIONID}} if no revision is set */ private $mSpeculativeRevId; /** @var int Upper bound of expiry based on parse duration */ private $mMaxAdaptiveExpiry = INF; const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)())#s'; // finalizeAdaptiveCacheExpiry() uses TTL = MAX( m * PARSE_TIME + b, MIN_AR_TTL) // Current values imply that m=3933.333333 and b=-333.333333 // See https://www.nngroup.com/articles/website-response-times/ const PARSE_FAST_SEC = 0.100; // perceived "fast" page parse const PARSE_SLOW_SEC = 1.0; // perceived "slow" page parse const FAST_AR_TTL = 60; // adaptive TTL for "fast" pages const SLOW_AR_TTL = 3600; // adaptive TTL for "slow" pages const MIN_AR_TTL = 15; // min adaptive TTL (for sanity, pool counter, and edit stashing) public function __construct( $text = '', $languageLinks = [], $categoryLinks = [], $unused = false, $titletext = '' ) { $this->mText = $text; $this->mLanguageLinks = $languageLinks; $this->mCategories = $categoryLinks; $this->mTitleText = $titletext; } /** * Get the cacheable text with markers still in it. The * return value is suitable for writing back via setText() but is not valid * for display to the user. * * @return string * @since 1.27 */ public function getRawText() { return $this->mText; } /** * Get the output HTML * * @param array $options (since 1.31) Transformations to apply to the HTML * - allowTOC: (bool) Show the TOC, assuming there were enough headings * to generate one and `__NOTOC__` wasn't used. Default is true, * but might be statefully overridden. * - enableSectionEditLinks: (bool) Include section edit links, assuming * section edit link tokens are present in the HTML. Default is true, * but might be statefully overridden. * - unwrap: (bool) Remove a wrapping mw-parser-output div. Default is false. * - deduplicateStyles: (bool) When true, which is the default, `#s', function ( $m ) use ( &$seen ) { $attr = Sanitizer::decodeTagAttributes( $m[1] ); if ( !isset( $attr['data-mw-deduplicate'] ) ) { return $m[0]; } $key = $attr['data-mw-deduplicate']; if ( !isset( $seen[$key] ) ) { $seen[$key] = true; return $m[0]; } // We were going to use an empty