MediaWiki REL1_35
ParserOutput Class Reference
Inheritance diagram for ParserOutput:
Collaboration diagram for ParserOutput:

Public Member Functions

 __construct ( $text='', $languageLinks=[], $categoryLinks=[], $unused=false, $titletext='')
 
 __sleep ()
 
 addCategory ( $c, $sort)
 
 addExternalLink ( $url)
 
 addExtraCSPDefaultSrc ( $src)
 Add an extra value to Content-Security-Policy default-src directive.
 
 addExtraCSPScriptSrc ( $src)
 Add an extra value to Content-Security-Policy script-src directive.
 
 addExtraCSPStyleSrc ( $src)
 Add an extra value to Content-Security-Policy style-src directive.
 
 addHeadItem ( $section, $tag=false)
 Add some text to the "<head>".
 
 addImage ( $name, $timestamp=null, $sha1=null)
 Register a file dependency for this output.
 
 addInterwikiLink ( $title)
 
 addJsConfigVars ( $keys, $value=null)
 Add one or more variables to be set in mw.config in JavaScript.
 
 addLanguageLink ( $t)
 
 addLink (Title $title, $id=null)
 Record a local or interwiki inline link for saving in future link tables.
 
 addModules ( $modules)
 
 addModuleStyles ( $modules)
 
 addOutputHook ( $hook, $data=false)
 
 addOutputPageMetadata (OutputPage $out)
 Copy items from the OutputPage object into this one.
 
 addTemplate ( $title, $page_id, $rev_id)
 Register a template dependency for this output.
 
 addTrackingCategory ( $msg, $title)
 Add a tracking category, getting the title from a system message, or print a debug message if the title is invalid.
 
 addWarning ( $s)
 
 addWrapperDivClass ( $class)
 Add a CSS class to use for the wrapping div.
 
 clearWrapperDivClass ()
 Clears the CSS class to use for the wrapping div, effectively disabling the wrapper div until addWrapperDivClass() is called.
 
 finalizeAdaptiveCacheExpiry ()
 Call this when parsing is done to lower the TTL based on low parse times.
 
 getAllFlags ()
 
getCategories ()
 
 getCategoryLinks ()
 
 getDisplayTitle ()
 Get the title to be used for display.
 
 getEnableOOUI ()
 
 getExtensionData ( $key)
 Gets extensions data previously attached to this ParserOutput using setExtensionData().
 
getExternalLinks ()
 
 getExtraCSPDefaultSrcs ()
 Get extra Content-Security-Policy 'default-src' directives.
 
 getExtraCSPScriptSrcs ()
 Get extra Content-Security-Policy 'script-src' directives.
 
 getExtraCSPStyleSrcs ()
 Get extra Content-Security-Policy 'style-src' directives.
 
getFileSearchOptions ()
 
 getFlag ( $flag)
 
 getHeadItems ()
 
 getHideNewSection ()
 
getImages ()
 
 getIndexPolicy ()
 
 getIndicators ()
 
 getInterwikiLinks ()
 
 getJsConfigVars ()
 
getLanguageLinks ()
 
 getLimitReportData ()
 
 getLimitReportJSData ()
 
getLinks ()
 
getLinksSpecial ()
 
 getModules ()
 
 getModuleStyles ()
 
 getNewSection ()
 
 getNoGallery ()
 
 getOutputHooks ()
 
 getProperties ()
 
 getProperty ( $name)
 
 getRawText ()
 Get the cacheable text with <mw:editsection> markers still in it.
 
 getRevisionTimestampUsed ()
 
 getRevisionUsedSha1Base36 ()
 
 getSections ()
 
 getSpeculativePageIdUsed ()
 
 getSpeculativeRevIdUsed ()
 
getTemplateIds ()
 
getTemplates ()
 
 getText ( $options=[])
 Get the output HTML.
 
 getTimeSinceStart ( $clock)
 Returns the time since resetParseStartTime() was last called.
 
 getTimestamp ()
 
 getTitleText ()
 
 getTOCHTML ()
 
 getUsedOptions ()
 Returns the options from its ParserOptions which have been taken into account to produce this output.
 
 getWarnings ()
 
 getWrapperDivClass ()
 Returns the class (or classes) to be used with the wrapper div for this otuput.
 
 hasDynamicContent ()
 Check whether the cache TTL was lowered due to dynamic content.
 
 hasText ()
 Returns true if text was passed to the constructor, or set using setText().
 
 hideNewSection ( $value)
 
 mergeHtmlMetaDataFrom (ParserOutput $source)
 Merges HTML metadata such as head items, JS config vars, and HTTP cache control info from $source into this ParserOutput.
 
 mergeInternalMetaDataFrom (ParserOutput $source)
 Merges internal metadata such as flags, accessed options, and profiling info from $source into this ParserOutput.
 
 mergeTrackingMetaDataFrom (ParserOutput $source)
 Merges dependency tracking metadata such as backlinks, images used, and extension data from $source into this ParserOutput.
 
 preventClickjacking ( $flag=null)
 Get or set the prevent-clickjacking flag.
 
 recordOption ( $option)
 Tags a parser option for use in the cache key for this parser output.
 
 resetParseStartTime ()
 Resets the parse start timestamps for future calls to getTimeSinceStart()
 
 setCategoryLinks ( $cl)
 
 setDisplayTitle ( $text)
 Override the title to be used for display.
 
 setEnableOOUI ( $enable=false)
 Enables OOUI, if true, in any OutputPage instance this ParserOutput object is added to.
 
 setExtensionData ( $key, $value)
 Attaches arbitrary data to this ParserObject.
 
 setFlag ( $flag)
 Attach a flag to the output so that it can be checked later to handle special cases.
 
 setIndexPolicy ( $policy)
 
 setIndicator ( $id, $content)
 
 setLanguageLinks ( $ll)
 
 setLimitReportData ( $key, $value)
 Sets parser limit report data for a key.
 
 setNewSection ( $value)
 
 setNoGallery ( $value)
 
 setProperty ( $name, $value)
 Set a property to be stored in the page_props database table.
 
 setRevisionTimestampUsed ( $timestamp)
 
 setRevisionUsedSha1Base36 ( $hash)
 
 setSections ( $toc)
 
 setSpeculativePageIdUsed ( $id)
 
 setSpeculativeRevIdUsed ( $id)
 
 setText ( $text)
 
 setTimestamp ( $timestamp)
 
 setTitleText ( $t)
 
 setTOCHTML ( $tochtml)
 
 unsetProperty ( $name)
 
 updateRuntimeAdaptiveExpiry ( $ttl)
 Lower the runtime adaptive TTL to at most this value.
 
- Public Member Functions inherited from CacheTime
 expired ( $touched)
 Return true if this cached output object predates the global or per-article cache invalidation timestamps, or if it comes from an incompatible older version.
 
 getCacheExpiry ()
 Returns the number of seconds after which this object should expire.
 
 getCacheRevisionId ()
 
 getCacheTime ()
 
 isCacheable ()
 
 isDifferentRevision ( $id)
 Return true if this cached output object is for a different revision of the page.
 
 setCacheRevisionId ( $id)
 
 setCacheTime ( $t)
 setCacheTime() sets the timestamp expressing when the page has been rendered.
 
 updateCacheExpiry ( $seconds)
 Sets the number of seconds after which this object should expire.
 

Static Public Member Functions

static isLinkInternal ( $internal, $url)
 Checks, if a url is pointing to the own server.
 

Public Attributes

array $mCategories
 Map of category names to sort keys.
 
bool $mEnableOOUI = false
 Whether OOUI should be enabled.
 
array $mExternalLinks = []
 External link URLs, in the key only.
 
array $mFileSearchOptions = []
 DB keys of the images used mapped to sha1 and MW timestamp.
 
array $mHeadItems = []
 Items to put in the <head> section.
 
bool $mHideNewSection = false
 Hide the new section link?
 
array $mImages = []
 DB keys of the images used, in the array key only.
 
array $mIndicators = []
 Page status indicators, usually displayed in top-right corner.
 
array $mInterwikiLinks = []
 2-D map of prefix/DBK (in keys only) for the inline interwiki links in the document.
 
array $mJsConfigVars = []
 JavaScript config variable for mw.config combined with this page.
 
array $mLanguageLinks
 List of the full text of language links, in the order they appear.
 
int[][] $mLinks = []
 2-D map of NS/DBK to ID for the links in the document.
 
array $mLinksSpecial = []
 Keys are DBKs for the links to special pages in the document.
 
array $mModules = []
 Modules to be loaded by ResourceLoader.
 
array $mModuleStyles = []
 Modules of which only the CSSS will be loaded by ResourceLoader.
 
bool $mNewSection = false
 Show a new section link?
 
bool $mNoGallery = false
 No gallery on category page? (NOGALLERY).
 
array $mOutputHooks = []
 Hook tags as per $wgParserOutputHooks.
 
array $mProperties = []
 Name/value pairs to be cached in the DB.
 
array $mSections = []
 Table of contents.
 
array $mTemplateIds = []
 2-D map of NS/DBK to rev ID for the template references.
 
array $mTemplates = []
 2-D map of NS/DBK to ID for the template references.
 
string null $mText = null
 The output text.
 
string $mTimestamp
 Timestamp of the revision.
 
string $mTitleText
 Title text of the chosen language variant, as HTML.
 
string $mTOCHTML = ''
 HTML of the TOC.
 
array $mWarnings = []
 Warning text to be returned to the user.
 
const SUPPORTS_STATELESS_TRANSFORMS = 1
 Feature flags to indicate to extensions that MediaWiki core supports and uses getText() stateless transforms.
 
const SUPPORTS_UNWRAP_TRANSFORM = 1
 
- Public Attributes inherited from CacheTime
int null $mCacheExpiry = null
 Seconds after which the object should expire, use 0 for not cacheable.
 
int null $mCacheRevisionId = null
 Revision ID that was parsed.
 
string int $mCacheTime = ''
 TS_MW timestamp when this object was generated, or -1 for not cacheable.
 
string[] $mUsedOptions
 ParserOptions which have been taken into account to produce output.
 
string null $mVersion = Parser::VERSION
 Compatibility check.
 

Static Private Member Functions

static getTimes ( $clock=null)
 
static merge2D (array $a, array $b)
 
static mergeList (array $a, array $b)
 
static mergeMap (array $a, array $b)
 
static mergeMixedList (array $a, array $b)
 
static useEachMinValue (array $a, array $b)
 
static useMaxValue ( $a, $b)
 
static useMinValue ( $a, $b)
 

Private Attributes

true[] $mAccessedOptions = []
 List of ParserOptions (stored in the keys).
 
array $mExtensionData = []
 extra data used by extensions.
 
array $mExtraDefaultSrcs = []
 Extra default-src for CSP [Everything but script and style].
 
array $mExtraScriptSrcs = []
 Extra script-src for CSP.
 
array $mExtraStyleSrcs = []
 Extra style-src for CSP.
 
array $mFlags = []
 Generic flags.
 
string $mIndexPolicy = ''
 'index' or 'noindex'? Any other value will result in no change.
 
array $mLimitReportData = []
 Parser limit report data.
 
array $mLimitReportJSData = []
 Parser limit report data for JSON.
 
int $mMaxAdaptiveExpiry = INF
 Upper bound of expiry based on parse duration.
 
array $mParseStartTime = []
 Timestamps for getTimeSinceStart().
 
bool $mPreventClickjacking = false
 Whether to emit X-Frame-Options: DENY.
 
int null $mSpeculativeRevId
 Assumed rev ID for {{REVISIONID}} if no revision is set.
 
 $mWrapperDivClasses = []
 string CSS classes to use for the wrapping div, stored in the array keys.
 
int null $revisionTimestampUsed
 Assumed rev timestamp for {{REVISIONTIMESTAMP}} if no revision is set.
 
string null $revisionUsedSha1Base36
 SHA-1 base 36 hash of any self-transclusion.
 
int null $speculativePageIdUsed
 Assumed page ID for {{PAGEID}} if no revision is set.
 
const EDITSECTION_REGEX
 
const FAST_AR_TTL = 60
 
const MIN_AR_TTL = 15
 
const PARSE_FAST_SEC = 0.100
 
const PARSE_SLOW_SEC = 1.0
 
const SLOW_AR_TTL = 3600
 

Detailed Description

Definition at line 27 of file ParserOutput.php.

Constructor & Destructor Documentation

◆ __construct()

ParserOutput::__construct (   $text = '',
  $languageLinks = [],
  $categoryLinks = [],
  $unused = false,
  $titletext = '' 
)
Parameters
string | null$textHTML. 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.
array$languageLinks
array$categoryLinks
bool$unused
string$titletext

Definition at line 283 of file ParserOutput.php.

Member Function Documentation

◆ __sleep()

ParserOutput::__sleep ( )

Definition at line 1437 of file ParserOutput.php.

◆ addCategory()

ParserOutput::addCategory (   $c,
  $sort 
)

Definition at line 745 of file ParserOutput.php.

Referenced by addTrackingCategory().

◆ addExternalLink()

ParserOutput::addExternalLink (   $url)

Definition at line 815 of file ParserOutput.php.

References $wgRegisterInternalExternals, and $wgServer.

◆ addExtraCSPDefaultSrc()

ParserOutput::addExtraCSPDefaultSrc (   $src)

Add an extra value to Content-Security-Policy default-src directive.

Call this if you are including a resource (e.g. image) from a third party domain. This is used for all source types except style and script.

Since
1.35
Parameters
string$srcCSP source e.g. example.com

Definition at line 1386 of file ParserOutput.php.

◆ addExtraCSPScriptSrc()

ParserOutput::addExtraCSPScriptSrc (   $src)

Add an extra value to Content-Security-Policy script-src directive.

Call this if you are loading third-party Javascript

Since
1.35
Parameters
string$srcCSP source e.g. example.com

Definition at line 1408 of file ParserOutput.php.

◆ addExtraCSPStyleSrc()

ParserOutput::addExtraCSPStyleSrc (   $src)

Add an extra value to Content-Security-Policy style-src directive.

Since
1.35
Parameters
string$srcCSP source e.g. example.com

Definition at line 1396 of file ParserOutput.php.

◆ addHeadItem()

ParserOutput::addHeadItem (   $section,
  $tag = false 
)

Add some text to the "<head>".

If $tag is set, the section with that tag will only be included once in a given page.

Parameters
string$section
string | bool$tag

Definition at line 921 of file ParserOutput.php.

◆ addImage()

ParserOutput::addImage (   $name,
  $timestamp = null,
  $sha1 = null 
)

Register a file dependency for this output.

Parameters
string$nameTitle dbKey
string | false | null$timestampMW timestamp of file creation (or false if non-existing)
string | false | null$sha1Base 36 SHA-1 of file (or false if non-existing)

Definition at line 873 of file ParserOutput.php.

◆ addInterwikiLink()

ParserOutput::addInterwikiLink (   $title)
Parameters
Title$titleTitle object, must be an interwiki link
Exceptions
MWExceptionIf given invalid input

Definition at line 903 of file ParserOutput.php.

References $title.

Referenced by addLink().

◆ addJsConfigVars()

ParserOutput::addJsConfigVars (   $keys,
  $value = null 
)

Add one or more variables to be set in mw.config in JavaScript.

Parameters
string | array$keysKey or array of key/value pairs.
mixed | null$value[optional] Value of the configuration variable.
Since
1.23

Definition at line 952 of file ParserOutput.php.

References $keys.

Referenced by addOutputPageMetadata().

◆ addLanguageLink()

ParserOutput::addLanguageLink (   $t)

Definition at line 769 of file ParserOutput.php.

References $t.

◆ addLink()

ParserOutput::addLink ( Title  $title,
  $id = null 
)

Record a local or interwiki inline link for saving in future link tables.

Parameters
Title$title
int | null$idOptional known page_id so we can skip the lookup

Definition at line 838 of file ParserOutput.php.

References $title, addInterwikiLink(), NS_FILE, NS_MEDIA, and NS_SPECIAL.

Referenced by WikitextContent\fillParserOutput().

◆ addModules()

ParserOutput::addModules (   $modules)
See also
OutputPage::addModules
Parameters
string | array$modules

Definition at line 933 of file ParserOutput.php.

References $modules.

Referenced by addOutputPageMetadata().

◆ addModuleStyles()

ParserOutput::addModuleStyles (   $modules)
See also
OutputPage::addModuleStyles
Parameters
string | array$modules

Definition at line 941 of file ParserOutput.php.

References $modules.

Referenced by addOutputPageMetadata(), JsonContent\fillParserOutput(), and WikitextContent\fillParserOutput().

◆ addOutputHook()

ParserOutput::addOutputHook (   $hook,
  $data = false 
)

Definition at line 777 of file ParserOutput.php.

◆ addOutputPageMetadata()

ParserOutput::addOutputPageMetadata ( OutputPage  $out)

◆ addTemplate()

ParserOutput::addTemplate (   $title,
  $page_id,
  $rev_id 
)

Register a template dependency for this output.

Parameters
Title$title
int$page_id
int$rev_id

Definition at line 886 of file ParserOutput.php.

References $title.

◆ addTrackingCategory()

ParserOutput::addTrackingCategory (   $msg,
  $title 
)

Add a tracking category, getting the title from a system message, or print a debug message if the title is invalid.

Any message used with this function should be registered so it will show up on Special:TrackingCategories. Core messages should be added to SpecialTrackingCategories::$coreTrackingCategories, and extensions should add to "TrackingCategories" in their extension.json.

Todo:
Migrate some code to TrackingCategories
Parameters
string$msgMessage key
Title$titletitle of the page which is being tracked
Returns
bool Whether the addition was successful
Since
1.25

Definition at line 993 of file ParserOutput.php.

References $title, addCategory(), NS_CATEGORY, wfDebug(), and wfMessage().

◆ addWarning()

ParserOutput::addWarning (   $s)

Definition at line 773 of file ParserOutput.php.

References $s.

◆ addWrapperDivClass()

ParserOutput::addWrapperDivClass (   $class)

Add a CSS class to use for the wrapping div.

If no class is given, no wrapper is added.

Parameters
string$class

Definition at line 461 of file ParserOutput.php.

◆ clearWrapperDivClass()

ParserOutput::clearWrapperDivClass ( )

Clears the CSS class to use for the wrapping div, effectively disabling the wrapper div until addWrapperDivClass() is called.

Definition at line 469 of file ParserOutput.php.

Referenced by TextContent\fillParserOutput().

◆ finalizeAdaptiveCacheExpiry()

ParserOutput::finalizeAdaptiveCacheExpiry ( )

Call this when parsing is done to lower the TTL based on low parse times.

Since
1.28

Definition at line 1417 of file ParserOutput.php.

References getTimeSinceStart(), and CacheTime\updateCacheExpiry().

◆ getAllFlags()

ParserOutput::getAllFlags ( )
Returns
string[] List of flags signifying special cases
Since
1.34

Definition at line 1073 of file ParserOutput.php.

◆ getCategories()

& ParserOutput::getCategories ( )

◆ getCategoryLinks()

ParserOutput::getCategoryLinks ( )

◆ getDisplayTitle()

ParserOutput::getDisplayTitle ( )

Get the title to be used for display.

As per the contract of setDisplayTitle(), this is safe HTML, ready to be served to the client.

Returns
string HTML

Definition at line 1044 of file ParserOutput.php.

References $t, and getTitleText().

◆ getEnableOOUI()

ParserOutput::getEnableOOUI ( )

Definition at line 682 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getExtensionData()

ParserOutput::getExtensionData (   $key)

Gets extensions data previously attached to this ParserOutput using setExtensionData().

Typically, such data would be set while parsing the page, e.g. by a parser function.

Since
1.21
Parameters
string$keyThe key to look up.
Returns
mixed|null The value previously set for the given key using setExtensionData() or null if no value was set for this key.

Definition at line 1251 of file ParserOutput.php.

◆ getExternalLinks()

& ParserOutput::getExternalLinks ( )

◆ getExtraCSPDefaultSrcs()

ParserOutput::getExtraCSPDefaultSrcs ( )

Get extra Content-Security-Policy 'default-src' directives.

Since
1.35
Returns
array

Definition at line 691 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getExtraCSPScriptSrcs()

ParserOutput::getExtraCSPScriptSrcs ( )

Get extra Content-Security-Policy 'script-src' directives.

Since
1.35
Returns
array

Definition at line 700 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getExtraCSPStyleSrcs()

ParserOutput::getExtraCSPStyleSrcs ( )

Get extra Content-Security-Policy 'style-src' directives.

Since
1.35
Returns
array

Definition at line 709 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getFileSearchOptions()

& ParserOutput::getFileSearchOptions ( )

Definition at line 615 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getFlag()

ParserOutput::getFlag (   $flag)
Parameters
string$flag
Returns
bool Whether the given flag was set to signify a special case

Definition at line 1065 of file ParserOutput.php.

Referenced by MediaWiki\Revision\RenderedRevision\outputVariesOnRevisionMetaData(), and MediaWiki\Storage\PageEditStash\storeStashValue().

◆ getHeadItems()

ParserOutput::getHeadItems ( )

Definition at line 631 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getHideNewSection()

ParserOutput::getHideNewSection ( )

Definition at line 789 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getImages()

& ParserOutput::getImages ( )

◆ getIndexPolicy()

ParserOutput::getIndexPolicy ( )

Definition at line 659 of file ParserOutput.php.

◆ getIndicators()

ParserOutput::getIndicators ( )
Returns
array
Since
1.25

Definition at line 579 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getInterwikiLinks()

ParserOutput::getInterwikiLinks ( )

Definition at line 563 of file ParserOutput.php.

Referenced by LinksUpdate\__construct().

◆ getJsConfigVars()

ParserOutput::getJsConfigVars ( )
Returns
array
Since
1.23

Definition at line 647 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputContent(), and OutputPage\addParserOutputMetadata().

◆ getLanguageLinks()

& ParserOutput::getLanguageLinks ( )

◆ getLimitReportData()

ParserOutput::getLimitReportData ( )

Definition at line 674 of file ParserOutput.php.

◆ getLimitReportJSData()

ParserOutput::getLimitReportJSData ( )

Definition at line 678 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getLinks()

& ParserOutput::getLinks ( )

◆ getLinksSpecial()

& ParserOutput::getLinksSpecial ( )
Returns
array Keys are DBKs for the links to special pages in the document
Since
1.35

Definition at line 599 of file ParserOutput.php.

◆ getModules()

ParserOutput::getModules ( )

◆ getModuleStyles()

ParserOutput::getModuleStyles ( )

◆ getNewSection()

ParserOutput::getNewSection ( )

Definition at line 793 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getNoGallery()

ParserOutput::getNoGallery ( )

Definition at line 627 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getOutputHooks()

ParserOutput::getOutputHooks ( )

Definition at line 651 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getProperties()

ParserOutput::getProperties ( )

Definition at line 1157 of file ParserOutput.php.

Referenced by LinksUpdate\__construct().

◆ getProperty()

ParserOutput::getProperty (   $name)
Parameters
string$nameThe property name to look up.
Returns
mixed|bool The value previously set using setProperty(). False if null or no value was set for the given property name.
Note
You need to use getProperties() to check for boolean and null properties.

Definition at line 1149 of file ParserOutput.php.

◆ getRawText()

ParserOutput::getRawText ( )

Get the cacheable text with <mw:editsection> markers still in it.

The return value is suitable for writing back via setText() but is not valid for display to the user.

Returns
string
Since
1.27

Definition at line 314 of file ParserOutput.php.

References $mText.

Referenced by WikitextContent\fillParserOutput(), and getText().

◆ getRevisionTimestampUsed()

ParserOutput::getRevisionTimestampUsed ( )
Returns
string|null TS_MW timestamp or null if not used
Since
1.34

Definition at line 528 of file ParserOutput.php.

Referenced by MediaWiki\Revision\RenderedRevision\outputVariesOnRevisionMetaData().

◆ getRevisionUsedSha1Base36()

ParserOutput::getRevisionUsedSha1Base36 ( )
Returns
string|null Lowercase SHA-1 base 36 hash, null if unused, or "" on inconsistency
Since
1.34

Definition at line 555 of file ParserOutput.php.

Referenced by MediaWiki\Revision\RenderedRevision\outputVariesOnRevisionMetaData().

◆ getSections()

ParserOutput::getSections ( )

Definition at line 587 of file ParserOutput.php.

◆ getSpeculativePageIdUsed()

ParserOutput::getSpeculativePageIdUsed ( )
Returns
int|null
Since
1.34

Definition at line 512 of file ParserOutput.php.

Referenced by MediaWiki\Revision\RenderedRevision\outputVariesOnRevisionMetaData().

◆ getSpeculativeRevIdUsed()

ParserOutput::getSpeculativeRevIdUsed ( )
Returns
int|null
Since
1.28

Definition at line 496 of file ParserOutput.php.

Referenced by MediaWiki\Revision\RenderedRevision\outputVariesOnRevisionMetaData().

◆ getTemplateIds()

& ParserOutput::getTemplateIds ( )

Definition at line 607 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getTemplates()

& ParserOutput::getTemplates ( )

◆ getText()

ParserOutput::getText (   $options = [])

Get the output HTML.

Parameters
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.
  • skin: (Skin) Skin object used for transforming section edit links.
  • unwrap: (bool) Return text without a wrapper div. Default is false, meaning a wrapper div will be added if getWrapperDivClass() returns a non-empty string.
  • wrapperDivClass: (string) Wrap the output in a div and apply the given CSS class to that div. This overrides the output of getWrapperDivClass(). Setting this to an empty string has the same effect as 'unwrap' => true.
  • deduplicateStyles: (bool) When true, which is the default, <style> tags with the data-mw-deduplicate attribute set are deduplicated by value of the attribute: all but the first will be replaced by <link rel="mw-deduplicated-inline-style" href="mw-data:..."/> tags, where the scheme-specific-part of the href is the (percent-encoded) value of the data-mw-deduplicate attribute.
Returns
string HTML
-taint escaped

Definition at line 348 of file ParserOutput.php.

References getRawText(), getTitleText(), getWrapperDivClass(), and wfUrlencode().

Referenced by OutputPage\addParserOutputText(), Status\getHTML(), and Message\parseText().

◆ getTimes()

static ParserOutput::getTimes (   $clock = null)
staticprivate

Definition at line 1255 of file ParserOutput.php.

◆ getTimeSinceStart()

ParserOutput::getTimeSinceStart (   $clock)

Returns the time since resetParseStartTime() was last called.

Clocks available are:

  • wall: Wall clock time
  • cpu: CPU time (requires getrusage)
Since
1.22
Parameters
string$clock
Returns
float|null

Definition at line 1287 of file ParserOutput.php.

Referenced by finalizeAdaptiveCacheExpiry().

◆ getTimestamp()

ParserOutput::getTimestamp ( )
Returns
string|null TS_MW timestamp of the revision content

Definition at line 670 of file ParserOutput.php.

◆ getTitleText()

ParserOutput::getTitleText ( )

Definition at line 583 of file ParserOutput.php.

Referenced by Article\adjustDisplayTitle(), getDisplayTitle(), and getText().

◆ getTOCHTML()

ParserOutput::getTOCHTML ( )

Definition at line 663 of file ParserOutput.php.

Referenced by OutputPage\addParserOutputMetadata().

◆ getUsedOptions()

ParserOutput::getUsedOptions ( )

Returns the options from its ParserOptions which have been taken into account to produce this output.

Returns
string[]

Definition at line 1169 of file ParserOutput.php.

Referenced by ParserCache\save().

◆ getWarnings()

ParserOutput::getWarnings ( )

Definition at line 655 of file ParserOutput.php.

◆ getWrapperDivClass()

ParserOutput::getWrapperDivClass ( )

Returns the class (or classes) to be used with the wrapper div for this otuput.

If there is no wrapper class given, no wrapper div should be added. The wrapper div is added automatically by getText().

Returns
string

Definition at line 480 of file ParserOutput.php.

Referenced by getText().

◆ hasDynamicContent()

ParserOutput::hasDynamicContent ( )

Check whether the cache TTL was lowered due to dynamic content.

When content is determined by more than hard state (e.g. page edits), such as template/file transclusions based on the current timestamp or extension tags that generate lists based on queries, this return true.

Returns
bool
Since
1.25

Definition at line 1349 of file ParserOutput.php.

References $wgParserCacheExpireTime, and CacheTime\getCacheExpiry().

Referenced by WikiPage\triggerOpportunisticLinksUpdate().

◆ hasText()

ParserOutput::hasText ( )

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
Returns
bool Whether this ParserOutput contains rendered text. If this returns false, the ParserOutput contains meta-data only.

Definition at line 302 of file ParserOutput.php.

Referenced by ParserCache\save().

◆ hideNewSection()

ParserOutput::hideNewSection (   $value)

Definition at line 785 of file ParserOutput.php.

◆ isLinkInternal()

static ParserOutput::isLinkInternal (   $internal,
  $url 
)
static

Checks, if a url is pointing to the own server.

Parameters
string$internalThe server to check against
string$urlThe url to check
Returns
bool

Definition at line 804 of file ParserOutput.php.

◆ merge2D()

static ParserOutput::merge2D ( array  $a,
array  $b 
)
staticprivate

Definition at line 1607 of file ParserOutput.php.

References $keys.

◆ mergeHtmlMetaDataFrom()

ParserOutput::mergeHtmlMetaDataFrom ( ParserOutput  $source)

Merges HTML metadata such as head items, JS config vars, and HTTP cache control info from $source into this ParserOutput.

This should be used whenever the HTML in $source has been somehow mered into the HTML of this ParserOutput.

Parameters
ParserOutput$source

Definition at line 1496 of file ParserOutput.php.

References $source.

◆ mergeInternalMetaDataFrom()

ParserOutput::mergeInternalMetaDataFrom ( ParserOutput  $source)

Merges internal metadata such as flags, accessed options, and profiling info from $source into this ParserOutput.

This should be used whenever the state of $source has any impact on the state of this ParserOutput.

Parameters
ParserOutput$source

Definition at line 1460 of file ParserOutput.php.

References $source, useEachMinValue(), useMaxValue(), and wfLogWarning().

◆ mergeList()

static ParserOutput::mergeList ( array  $a,
array  $b 
)
staticprivate

Definition at line 1599 of file ParserOutput.php.

◆ mergeMap()

static ParserOutput::mergeMap ( array  $a,
array  $b 
)
staticprivate

Definition at line 1603 of file ParserOutput.php.

◆ mergeMixedList()

static ParserOutput::mergeMixedList ( array  $a,
array  $b 
)
staticprivate

Definition at line 1595 of file ParserOutput.php.

◆ mergeTrackingMetaDataFrom()

ParserOutput::mergeTrackingMetaDataFrom ( ParserOutput  $source)

Merges dependency tracking metadata such as backlinks, images used, and extension data from $source into this ParserOutput.

This allows dependency tracking to be done for the combined output of multiple content slots.

Parameters
ParserOutput$source

Definition at line 1565 of file ParserOutput.php.

References $source.

◆ preventClickjacking()

ParserOutput::preventClickjacking (   $flag = null)

Get or set the prevent-clickjacking flag.

Since
1.24
Parameters
bool | null$flagNew flag value, or null to leave it unchanged
Returns
bool Old flag value

Definition at line 1362 of file ParserOutput.php.

References wfSetVar().

Referenced by OutputPage\addParserOutputMetadata().

◆ recordOption()

ParserOutput::recordOption (   $option)

Tags a parser option for use in the cache key for this parser output.

Registered as a watcher at ParserOptions::registerWatcher() by Parser::clearState(). The information gathered here is available via getUsedOptions(), and is used by ParserCache::save().

See also
ParserCache::getKey
ParserCache::save
ParserOptions::addExtraKey
ParserOptions::optionsHash
Parameters
string$option

Definition at line 1188 of file ParserOutput.php.

◆ resetParseStartTime()

ParserOutput::resetParseStartTime ( )

Resets the parse start timestamps for future calls to getTimeSinceStart()

Since
1.22

Definition at line 1272 of file ParserOutput.php.

◆ setCategoryLinks()

ParserOutput::setCategoryLinks (   $cl)

Definition at line 721 of file ParserOutput.php.

References wfSetVar().

◆ setDisplayTitle()

ParserOutput::setDisplayTitle (   $text)

Override the title to be used for display.

Note
this is assumed to have been validated (check equal normalisation, etc.)
this is expected to be safe HTML, ready to be served to the client.
Parameters
string$textDesired title text

Definition at line 1031 of file ParserOutput.php.

References setProperty(), and setTitleText().

◆ setEnableOOUI()

ParserOutput::setEnableOOUI (   $enable = false)

Enables OOUI, if true, in any OutputPage instance this ParserOutput object is added to.

Since
1.26
Parameters
bool$enableIf OOUI should be enabled or not

Definition at line 765 of file ParserOutput.php.

◆ setExtensionData()

ParserOutput::setExtensionData (   $key,
  $value 
)

Attaches arbitrary data to this ParserObject.

This can be used to store some information in the ParserOutput object for later use during page output. The data will be cached along with the ParserOutput object, but unlike data set using setProperty(), it is not recorded in the database.

This method is provided to overcome the unsafe practice of attaching extra information to a ParserObject by directly assigning member variables.

To use setExtensionData() to pass extension information from a hook inside the parser to a hook in the page output, use this in the parser hook:

Example:
$parser->getOutput()->setExtensionData( 'my_ext_foo', '...' );

And then later, in OutputPageParserOutput or similar:

Example:
$output->getExtensionData( 'my_ext_foo' );

In MediaWiki 1.20 and older, you have to use a custom member variable within the ParserOutput object:

Example:
$parser->getOutput()->my_ext_foo = '...';
Since
1.21
Parameters
string$keyThe key for accessing the data. Extensions should take care to avoid conflicts in naming keys. It is suggested to use the extension's name as a prefix.
mixed$valueThe value to set. Setting a value to null is equivalent to removing the value.

Definition at line 1232 of file ParserOutput.php.

◆ setFlag()

ParserOutput::setFlag (   $flag)

Attach a flag to the output so that it can be checked later to handle special cases.

Parameters
string$flag

Definition at line 1057 of file ParserOutput.php.

Referenced by WikitextContent\fillParserOutput().

◆ setIndexPolicy()

ParserOutput::setIndexPolicy (   $policy)

Definition at line 733 of file ParserOutput.php.

References wfSetVar().

◆ setIndicator()

ParserOutput::setIndicator (   $id,
  $content 
)
Parameters
string$id
string$content
Since
1.25

Definition at line 754 of file ParserOutput.php.

References $content.

◆ setLanguageLinks()

ParserOutput::setLanguageLinks (   $ll)

Definition at line 717 of file ParserOutput.php.

References wfSetVar().

◆ setLimitReportData()

ParserOutput::setLimitReportData (   $key,
  $value 
)

Sets parser limit report data for a key.

The key is used as the prefix for various messages used for formatting:

  • $key: The label for the field in the limit report
  • $key-value-text: Message used to format the value in the "NewPP limit report" HTML comment. If missing, uses $key-format.
  • $key-value-html: Message used to format the value in the preview limit report table. If missing, uses $key-format.
  • $key-value: Message used to format the value. If missing, uses "$1".

Note that all values are interpreted as wikitext, and so should be encoded with htmlspecialchars() as necessary, but should avoid complex HTML for sanity of display in the "NewPP limit report" comment.

Since
1.22
Parameters
string$keyMessage key
mixed$valueAppropriate for Message::params()

Definition at line 1315 of file ParserOutput.php.

◆ setNewSection()

ParserOutput::setNewSection (   $value)

Definition at line 781 of file ParserOutput.php.

◆ setNoGallery()

ParserOutput::setNoGallery (   $value)

Definition at line 623 of file ParserOutput.php.

◆ setProperty()

ParserOutput::setProperty (   $name,
  $value 
)

Set a property to be stored in the page_props database table.

page_props is a key value store indexed by the page ID. This allows the parser to set a property on a page which can then be quickly retrieved given the page ID or via a DB join when given the page title.

Since 1.23, page_props are also indexed by numeric value, to allow for efficient "top k" queries of pages wrt a given property.

setProperty() is thus used to propagate properties from the parsed page to request contexts other than a page view of the currently parsed article.

Some applications examples:

  • To implement hidden categories, hiding pages from category listings by storing a property.
  • Overriding the displayed article title (ParserOutput::setDisplayTitle()).
  • To implement image tagging, for example displaying an icon on an image thumbnail to indicate that it is listed for deletion on Wikimedia Commons. This is not actually implemented, yet but would be pretty cool.
Note
Do not use setProperty() to set a property which is only used in a context where the ParserOutput object itself is already available, for example a normal page view. There is no need to save such a property in the database since the text is already parsed. You can just hook OutputPageParserOutput and get your data out of the ParserOutput object.

If you are writing an extension where you want to set a property in the parser which is used by an OutputPageParserOutput hook, you have to associate the extension data directly with the ParserOutput object. Since MediaWiki 1.21, you can use setExtensionData() to do this:

Example:
$parser->getOutput()->setExtensionData( 'my_ext_foo', '...' );

And then later, in OutputPageParserOutput or similar:

Example:
$output->getExtensionData( 'my_ext_foo' );

In MediaWiki 1.20 and older, you have to use a custom member variable within the ParserOutput object:

Example:
$parser->getOutput()->my_ext_foo = '...';
Parameters
string$name
mixed$value

Definition at line 1137 of file ParserOutput.php.

Referenced by setDisplayTitle().

◆ setRevisionTimestampUsed()

ParserOutput::setRevisionTimestampUsed (   $timestamp)
Parameters
string$timestampTS_MW timestamp
Since
1.34

Definition at line 520 of file ParserOutput.php.

◆ setRevisionUsedSha1Base36()

ParserOutput::setRevisionUsedSha1Base36 (   $hash)
Parameters
string$hashLowercase SHA-1 base 36 hash
Since
1.34

Definition at line 536 of file ParserOutput.php.

◆ setSections()

ParserOutput::setSections (   $toc)

Definition at line 729 of file ParserOutput.php.

References wfSetVar().

◆ setSpeculativePageIdUsed()

ParserOutput::setSpeculativePageIdUsed (   $id)
Parameters
int$id
Since
1.34

Definition at line 504 of file ParserOutput.php.

◆ setSpeculativeRevIdUsed()

ParserOutput::setSpeculativeRevIdUsed (   $id)
Parameters
int$id
Since
1.28

Definition at line 488 of file ParserOutput.php.

◆ setText()

◆ setTimestamp()

ParserOutput::setTimestamp (   $timestamp)

Definition at line 741 of file ParserOutput.php.

References wfSetVar().

Referenced by ParserCache\save().

◆ setTitleText()

ParserOutput::setTitleText (   $t)

Definition at line 725 of file ParserOutput.php.

References $t, and wfSetVar().

Referenced by setDisplayTitle().

◆ setTOCHTML()

ParserOutput::setTOCHTML (   $tochtml)

Definition at line 737 of file ParserOutput.php.

References wfSetVar().

◆ unsetProperty()

ParserOutput::unsetProperty (   $name)

Definition at line 1153 of file ParserOutput.php.

◆ updateRuntimeAdaptiveExpiry()

ParserOutput::updateRuntimeAdaptiveExpiry (   $ttl)

Lower the runtime adaptive TTL to at most this value.

Parameters
int$ttl
Since
1.28

Definition at line 1372 of file ParserOutput.php.

References CacheTime\updateCacheExpiry().

◆ useEachMinValue()

static ParserOutput::useEachMinValue ( array  $a,
array  $b 
)
staticprivate

Definition at line 1626 of file ParserOutput.php.

References $keys.

Referenced by mergeInternalMetaDataFrom().

◆ useMaxValue()

static ParserOutput::useMaxValue (   $a,
  $b 
)
staticprivate

Definition at line 1653 of file ParserOutput.php.

Referenced by mergeInternalMetaDataFrom().

◆ useMinValue()

static ParserOutput::useMinValue (   $a,
  $b 
)
staticprivate

Definition at line 1641 of file ParserOutput.php.

Member Data Documentation

◆ $mAccessedOptions

true [] ParserOutput::$mAccessedOptions = []
private

List of ParserOptions (stored in the keys).

Definition at line 192 of file ParserOutput.php.

◆ $mCategories

array ParserOutput::$mCategories

Map of category names to sort keys.

Definition at line 55 of file ParserOutput.php.

◆ $mEnableOOUI

bool ParserOutput::$mEnableOOUI = false

Whether OOUI should be enabled.

Definition at line 182 of file ParserOutput.php.

◆ $mExtensionData

array ParserOutput::$mExtensionData = []
private

extra data used by extensions.

Definition at line 197 of file ParserOutput.php.

◆ $mExternalLinks

array ParserOutput::$mExternalLinks = []

External link URLs, in the key only.

Definition at line 105 of file ParserOutput.php.

◆ $mExtraDefaultSrcs

array ParserOutput::$mExtraDefaultSrcs = []
private

Extra default-src for CSP [Everything but script and style].

Definition at line 225 of file ParserOutput.php.

◆ $mExtraScriptSrcs

array ParserOutput::$mExtraScriptSrcs = []
private

Extra script-src for CSP.

Definition at line 220 of file ParserOutput.php.

◆ $mExtraStyleSrcs

array ParserOutput::$mExtraStyleSrcs = []
private

Extra style-src for CSP.

Definition at line 230 of file ParserOutput.php.

◆ $mFileSearchOptions

array ParserOutput::$mFileSearchOptions = []

DB keys of the images used mapped to sha1 and MW timestamp.

Definition at line 100 of file ParserOutput.php.

◆ $mFlags

array ParserOutput::$mFlags = []
private

Generic flags.

Definition at line 235 of file ParserOutput.php.

◆ $mHeadItems

array ParserOutput::$mHeadItems = []

Items to put in the <head> section.

Definition at line 131 of file ParserOutput.php.

◆ $mHideNewSection

bool ParserOutput::$mHideNewSection = false

Hide the new section link?

Definition at line 121 of file ParserOutput.php.

◆ $mImages

array ParserOutput::$mImages = []

DB keys of the images used, in the array key only.

Definition at line 95 of file ParserOutput.php.

◆ $mIndexPolicy

string ParserOutput::$mIndexPolicy = ''
private

'index' or 'noindex'? Any other value will result in no change.

Definition at line 187 of file ParserOutput.php.

◆ $mIndicators

array ParserOutput::$mIndicators = []

Page status indicators, usually displayed in top-right corner.

Definition at line 60 of file ParserOutput.php.

◆ $mInterwikiLinks

array ParserOutput::$mInterwikiLinks = []

2-D map of prefix/DBK (in keys only) for the inline interwiki links in the document.

Definition at line 111 of file ParserOutput.php.

◆ $mJsConfigVars

array ParserOutput::$mJsConfigVars = []

JavaScript config variable for mw.config combined with this page.

Definition at line 146 of file ParserOutput.php.

◆ $mLanguageLinks

array ParserOutput::$mLanguageLinks

List of the full text of language links, in the order they appear.

Definition at line 50 of file ParserOutput.php.

◆ $mLimitReportData

array ParserOutput::$mLimitReportData = []
private

Parser limit report data.

Definition at line 202 of file ParserOutput.php.

◆ $mLimitReportJSData

array ParserOutput::$mLimitReportJSData = []
private

Parser limit report data for JSON.

Definition at line 205 of file ParserOutput.php.

◆ $mLinks

int [][] ParserOutput::$mLinks = []

2-D map of NS/DBK to ID for the links in the document.

ID=zero for broken. -var array<int,array<string,int>>

Definition at line 72 of file ParserOutput.php.

◆ $mLinksSpecial

array ParserOutput::$mLinksSpecial = []

Keys are DBKs for the links to special pages in the document.

Since
1.35

Definition at line 78 of file ParserOutput.php.

◆ $mMaxAdaptiveExpiry

int ParserOutput::$mMaxAdaptiveExpiry = INF
private

Upper bound of expiry based on parse duration.

Definition at line 260 of file ParserOutput.php.

◆ $mModules

array ParserOutput::$mModules = []

Modules to be loaded by ResourceLoader.

Definition at line 136 of file ParserOutput.php.

◆ $mModuleStyles

array ParserOutput::$mModuleStyles = []

Modules of which only the CSSS will be loaded by ResourceLoader.

Definition at line 141 of file ParserOutput.php.

◆ $mNewSection

bool ParserOutput::$mNewSection = false

Show a new section link?

Definition at line 116 of file ParserOutput.php.

◆ $mNoGallery

bool ParserOutput::$mNoGallery = false

No gallery on category page? (NOGALLERY).

Definition at line 126 of file ParserOutput.php.

◆ $mOutputHooks

array ParserOutput::$mOutputHooks = []

Hook tags as per $wgParserOutputHooks.

Definition at line 151 of file ParserOutput.php.

◆ $mParseStartTime

array ParserOutput::$mParseStartTime = []
private

Timestamps for getTimeSinceStart().

Definition at line 210 of file ParserOutput.php.

◆ $mPreventClickjacking

bool ParserOutput::$mPreventClickjacking = false
private

Whether to emit X-Frame-Options: DENY.

Definition at line 215 of file ParserOutput.php.

◆ $mProperties

array ParserOutput::$mProperties = []

Name/value pairs to be cached in the DB.

Definition at line 167 of file ParserOutput.php.

◆ $mSections

array ParserOutput::$mSections = []

Table of contents.

Definition at line 162 of file ParserOutput.php.

◆ $mSpeculativeRevId

int null ParserOutput::$mSpeculativeRevId
private
Initial value:
=[,,]
private const SPECULATIVE_FIELDS
'speculativePageIdUsed'
'mSpeculativeRevId'
'revisionTimestampUsed'

Assumed rev ID for {{REVISIONID}} if no revision is set.

Definition at line 245 of file ParserOutput.php.

◆ $mTemplateIds

array ParserOutput::$mTemplateIds = []

2-D map of NS/DBK to rev ID for the template references.

ID=zero for broken.

Definition at line 90 of file ParserOutput.php.

◆ $mTemplates

array ParserOutput::$mTemplates = []

2-D map of NS/DBK to ID for the template references.

ID=zero for broken.

Definition at line 84 of file ParserOutput.php.

◆ $mText

string null ParserOutput::$mText = null

The output text.

Definition at line 44 of file ParserOutput.php.

◆ $mTimestamp

string ParserOutput::$mTimestamp

Timestamp of the revision.

Definition at line 177 of file ParserOutput.php.

◆ $mTitleText

string ParserOutput::$mTitleText

Title text of the chosen language variant, as HTML.

Definition at line 65 of file ParserOutput.php.

◆ $mTOCHTML

string ParserOutput::$mTOCHTML = ''

HTML of the TOC.

Definition at line 172 of file ParserOutput.php.

◆ $mWarnings

array ParserOutput::$mWarnings = []

Warning text to be returned to the user.

Wikitext formatted, in the key only.

Definition at line 157 of file ParserOutput.php.

◆ $mWrapperDivClasses

ParserOutput::$mWrapperDivClasses = []
private

string CSS classes to use for the wrapping div, stored in the array keys.

If no class is given, no wrapper is added.

Definition at line 257 of file ParserOutput.php.

◆ $revisionTimestampUsed

int null ParserOutput::$revisionTimestampUsed
private

Assumed rev timestamp for {{REVISIONTIMESTAMP}} if no revision is set.

Definition at line 249 of file ParserOutput.php.

◆ $revisionUsedSha1Base36

string null ParserOutput::$revisionUsedSha1Base36
private

SHA-1 base 36 hash of any self-transclusion.

Definition at line 252 of file ParserOutput.php.

◆ $speculativePageIdUsed

int null ParserOutput::$speculativePageIdUsed
private

Assumed page ID for {{PAGEID}} if no revision is set.

Definition at line 247 of file ParserOutput.php.

◆ EDITSECTION_REGEX

const ParserOutput::EDITSECTION_REGEX
private
Initial value:
=
'#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#s'

Definition at line 262 of file ParserOutput.php.

◆ FAST_AR_TTL

const ParserOutput::FAST_AR_TTL = 60
private

Definition at line 270 of file ParserOutput.php.

◆ MIN_AR_TTL

const ParserOutput::MIN_AR_TTL = 15
private

Definition at line 272 of file ParserOutput.php.

◆ PARSE_FAST_SEC

const ParserOutput::PARSE_FAST_SEC = 0.100
private

Definition at line 268 of file ParserOutput.php.

◆ PARSE_SLOW_SEC

const ParserOutput::PARSE_SLOW_SEC = 1.0
private

Definition at line 269 of file ParserOutput.php.

◆ SLOW_AR_TTL

const ParserOutput::SLOW_AR_TTL = 3600
private

Definition at line 271 of file ParserOutput.php.

◆ SUPPORTS_STATELESS_TRANSFORMS

const ParserOutput::SUPPORTS_STATELESS_TRANSFORMS = 1

Feature flags to indicate to extensions that MediaWiki core supports and uses getText() stateless transforms.

Since
1.31

Definition at line 34 of file ParserOutput.php.

◆ SUPPORTS_UNWRAP_TRANSFORM

const ParserOutput::SUPPORTS_UNWRAP_TRANSFORM = 1
Since
1.31

Definition at line 39 of file ParserOutput.php.


The documentation for this class was generated from the following file: