> */ public $mLinks = []; /** * @var array Keys are DBKs for the links to special pages in the document. * @since 1.35 */ public $mLinksSpecial = []; /** * @var array 2-D map of NS/DBK to ID for the template references. * ID=zero for broken. */ public $mTemplates = []; /** * @var array 2-D map of NS/DBK to rev ID for the template references. * ID=zero for broken. */ public $mTemplateIds = []; /** * @var array DB keys of the images used, in the array key only */ public $mImages = []; /** * @var array DB keys of the images used mapped to sha1 and MW timestamp. */ public $mFileSearchOptions = []; /** * @var array External link URLs, in the key only. */ public $mExternalLinks = []; /** * @var array 2-D map of prefix/DBK (in keys only) * for the inline interwiki links in the document. */ public $mInterwikiLinks = []; /** * @var bool Show a new section link? */ public $mNewSection = false; /** * @var bool Hide the new section link? */ public $mHideNewSection = false; /** * @var bool No gallery on category page? (__NOGALLERY__). */ public $mNoGallery = false; /** * @var array Items to put in the
section */ public $mHeadItems = []; /** * @var array Modules to be loaded by ResourceLoader */ public $mModules = []; /** * @var array Modules of which only the CSSS will be loaded by ResourceLoader. */ public $mModuleStyles = []; /** * @var array JavaScript config variable for mw.config combined with this page. */ public $mJsConfigVars = []; /** * @var array Hook tags as per $wgParserOutputHooks. */ public $mOutputHooks = []; /** * @var array Warning text to be returned to the user. * Wikitext formatted, in the key only. */ public $mWarnings = []; /** * @var array Table of contents */ public $mSections = []; /** * @var array Name/value pairs to be cached in the DB. */ public $mProperties = []; /** * @var string HTML of the TOC. */ public $mTOCHTML = ''; /** * @var string Timestamp of the revision. */ public $mTimestamp; /** * @var bool Whether OOUI should be enabled. */ public $mEnableOOUI = false; /** * @var string 'index' or 'noindex'? Any other value will result in no change. */ private $mIndexPolicy = ''; /** * @var true[] List of ParserOptions (stored in the keys). */ private $mAccessedOptions = []; /** * @var array extra data used by extensions. */ private $mExtensionData = []; /** * @var array Parser limit report data. */ private $mLimitReportData = []; /** @var array Parser limit report data for JSON */ private $mLimitReportJSData = []; /** * @var array Timestamps for getTimeSinceStart(). */ private $mParseStartTime = []; /** * @var bool Whether to emit X-Frame-Options: DENY. */ private $mPreventClickjacking = false; /** * @var array Extra script-src for CSP */ private $mExtraScriptSrcs = []; /** * @var array Extra default-src for CSP [Everything but script and style] */ private $mExtraDefaultSrcs = []; /** * @var array Extra style-src for CSP */ private $mExtraStyleSrcs = []; /** * @var array Generic flags. */ private $mFlags = []; /** @var string[] */ private const SPECULATIVE_FIELDS = [ 'speculativePageIdUsed', 'mSpeculativeRevId', 'revisionTimestampUsed' ]; /** @var int|null Assumed rev ID for {{REVISIONID}} if no revision is set */ private $mSpeculativeRevId; /** @var int|null Assumed page ID for {{PAGEID}} if no revision is set */ private $speculativePageIdUsed; /** @var int|null Assumed rev timestamp for {{REVISIONTIMESTAMP}} if no revision is set */ private $revisionTimestampUsed; /** @var string|null SHA-1 base 36 hash of any self-transclusion */ private $revisionUsedSha1Base36; /** string CSS classes to use for the wrapping div, stored in the array keys. * If no class is given, no wrapper is added. */ private $mWrapperDivClasses = []; /** @var int Upper bound of expiry based on parse duration */ private $mMaxAdaptiveExpiry = INF; private const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)((?:mw:)?editsection>))#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/ private const PARSE_FAST_SEC = 0.100; // perceived "fast" page parse private const PARSE_SLOW_SEC = 1.0; // perceived "slow" page parse private const FAST_AR_TTL = 60; // adaptive TTL for "fast" pages private const SLOW_AR_TTL = 3600; // adaptive TTL for "slow" pages private const MIN_AR_TTL = 15; // min adaptive TTL (for sanity, pool counter, and edit stashing) /** * @param string|null $text HTML. Use null to indicate that this ParserOutput contains only * meta-data, and the HTML output is undetermined, as opposed to empty. Passing null * here causes hasText() to return false. * @param array $languageLinks * @param array $categoryLinks * @param bool $unused * @param string $titletext */ public function __construct( $text = '', $languageLinks = [], $categoryLinks = [], $unused = false, $titletext = '' ) { $this->mText = $text; $this->mLanguageLinks = $languageLinks; $this->mCategories = $categoryLinks; $this->mTitleText = $titletext; } /** * Returns true if text was passed to the constructor, or set using setText(). Returns false * if null was passed to the $text parameter of the constructor to indicate that this * ParserOutput only contains meta-data, and the HTML output is undetermined. * * @since 1.32 * * @return bool Whether this ParserOutput contains rendered text. If this returns false, the * ParserOutput contains meta-data only. */ public function hasText() { return ( $this->mText !== null ); } /** * Get the cacheable text with