MediaWiki
1.34.0
|
Public Member Functions | |
__construct ( $text='', $languageLinks=[], $categoryLinks=[], $unused=false, $titletext='') | |
__sleep () | |
addCategory ( $c, $sort) | |
addExternalLink ( $url) | |
addHeadItem ( $section, $tag=false) | |
Add some text to the "<head>". More... | |
addImage ( $name, $timestamp=null, $sha1=null) | |
Register a file dependency for this output. More... | |
addInterwikiLink ( $title) | |
addJsConfigVars ( $keys, $value=null) | |
Add one or more variables to be set in mw.config in JavaScript. More... | |
addLanguageLink ( $t) | |
addLink (Title $title, $id=null) | |
Record a local or interwiki inline link for saving in future link tables. More... | |
addModules ( $modules) | |
addModuleStyles ( $modules) | |
addOutputHook ( $hook, $data=false) | |
addOutputPageMetadata (OutputPage $out) | |
Copy items from the OutputPage object into this one. More... | |
addTemplate ( $title, $page_id, $rev_id) | |
Register a template dependency for this output. More... | |
addTrackingCategory ( $msg, $title) | |
Add a tracking category, getting the title from a system message, or print a debug message if the title is invalid. More... | |
addWarning ( $s) | |
addWrapperDivClass ( $class) | |
Add a CSS class to use for the wrapping div. More... | |
clearWrapperDivClass () | |
Clears the CSS class to use for the wrapping div, effectively disabling the wrapper div until addWrapperDivClass() is called. More... | |
finalizeAdaptiveCacheExpiry () | |
Call this when parsing is done to lower the TTL based on low parse times. More... | |
getAllFlags () | |
& | getCategories () |
getCategoryLinks () | |
getDisplayTitle () | |
Get the title to be used for display. More... | |
getEnableOOUI () | |
getExtensionData ( $key) | |
Gets extensions data previously attached to this ParserOutput using setExtensionData(). More... | |
& | getExternalLinks () |
& | getFileSearchOptions () |
getFlag ( $flag) | |
getHeadItems () | |
getHideNewSection () | |
& | getImages () |
getIndexPolicy () | |
getIndicators () | |
getInterwikiLinks () | |
getJsConfigVars () | |
& | getLanguageLinks () |
getLimitReportData () | |
getLimitReportJSData () | |
& | getLinks () |
getModules () | |
getModuleStyles () | |
getNewSection () | |
getNoGallery () | |
getOutputHooks () | |
getProperties () | |
getProperty ( $name) | |
getRawText () | |
Get the cacheable text with <mw:editsection> markers still in it. More... | |
getRevisionTimestampUsed () | |
getRevisionUsedSha1Base36 () | |
getSections () | |
getSpeculativePageIdUsed () | |
getSpeculativeRevIdUsed () | |
& | getTemplateIds () |
& | getTemplates () |
getText ( $options=[]) | |
Get the output HTML. More... | |
getTimeSinceStart ( $clock) | |
Returns the time since resetParseStartTime() was last called. More... | |
getTimestamp () | |
getTitleText () | |
getTOCHTML () | |
getUsedOptions () | |
Returns the options from its ParserOptions which have been taken into account to produce this output. More... | |
getWarnings () | |
getWrapperDivClass () | |
Returns the class (or classes) to be used with the wrapper div for this otuput. More... | |
hasDynamicContent () | |
Check whether the cache TTL was lowered due to dynamic content. More... | |
hasText () | |
Returns true if text was passed to the constructor, or set using setText(). More... | |
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. More... | |
mergeInternalMetaDataFrom (ParserOutput $source) | |
Merges internal metadata such as flags, accessed options, and profiling info from $source into this ParserOutput. More... | |
mergeTrackingMetaDataFrom (ParserOutput $source) | |
Merges dependency tracking metadata such as backlinks, images used, and extension data from $source into this ParserOutput. More... | |
preventClickjacking ( $flag=null) | |
Get or set the prevent-clickjacking flag. More... | |
recordOption ( $option) | |
Tags a parser option for use in the cache key for this parser output. More... | |
resetParseStartTime () | |
Resets the parse start timestamps for future calls to getTimeSinceStart() More... | |
setCategoryLinks ( $cl) | |
setDisplayTitle ( $text) | |
Override the title to be used for display. More... | |
setEnableOOUI ( $enable=false) | |
Enables OOUI, if true, in any OutputPage instance this ParserOutput object is added to. More... | |
setExtensionData ( $key, $value) | |
Attaches arbitrary data to this ParserObject. More... | |
setFlag ( $flag) | |
Attach a flag to the output so that it can be checked later to handle special cases. More... | |
setIndexPolicy ( $policy) | |
setIndicator ( $id, $content) | |
setLanguageLinks ( $ll) | |
setLimitReportData ( $key, $value) | |
Sets parser limit report data for a key. More... | |
setNewSection ( $value) | |
setNoGallery ( $value) | |
setProperty ( $name, $value) | |
Set a property to be stored in the page_props database table. More... | |
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. More... | |
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. More... | |
getCacheExpiry () | |
Returns the number of seconds after which this object should expire. More... | |
getCacheRevisionId () | |
getCacheTime () | |
isCacheable () | |
isDifferentRevision ( $id) | |
Return true if this cached output object is for a different revision of the page. More... | |
setCacheRevisionId ( $id) | |
setCacheTime ( $t) | |
setCacheTime() sets the timestamp expressing when the page has been rendered. More... | |
updateCacheExpiry ( $seconds) | |
Sets the number of seconds after which this object should expire. More... | |
Static Public Member Functions | |
static | isLinkInternal ( $internal, $url) |
Checks, if a url is pointing to the own server. More... | |
Public Attributes | |
$mCategories | |
$mEnableOOUI = false | |
$mExternalLinks = [] | |
$mFileSearchOptions = [] | |
$mHeadItems = [] | |
$mHideNewSection = false | |
$mImages = [] | |
$mIndicators = [] | |
$mInterwikiLinks = [] | |
$mJsConfigVars = [] | |
$mLanguageLinks | |
$mLinks = [] | |
$mModules = [] | |
$mModuleStyles = [] | |
$mNewSection = false | |
$mNoGallery = false | |
$mOutputHooks = [] | |
$mProperties = [] | |
$mSections = [] | |
$mTemplateIds = [] | |
$mTemplates = [] | |
$mText = null | |
$mTimestamp | |
$mTitleText | |
$mTOCHTML = '' | |
$mWarnings = [] | |
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 |
const | SUPPORTS_STATELESS_TRANSFORMS = 1 |
Feature flags to indicate to extensions that MediaWiki core supports and uses getText() stateless transforms. More... | |
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. More... | |
int null | $mCacheRevisionId = null |
Revision ID that was parsed. More... | |
string int | $mCacheTime = '' |
TS_MW timestamp when this object was generated, or -1 for not cacheable. More... | |
string[] | $mUsedOptions |
ParserOptions which have been taken into account to produce output. More... | |
string null | $mVersion = Parser::VERSION |
Compatibility check. More... | |
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 | |
$mAccessedOptions = [] | |
$mExtensionData = [] | |
$mFlags = [] | |
$mIndexPolicy = '' | |
$mLimitReportData = [] | |
array | $mLimitReportJSData = [] |
Parser limit report data for JSON. More... | |
int | $mMaxAdaptiveExpiry = INF |
Upper bound of expiry based on parse duration. More... | |
$mParseStartTime = [] | |
$mPreventClickjacking = false | |
int null | $mSpeculativeRevId |
Assumed rev ID for {{REVISIONID}} if no revision is set. More... | |
$mWrapperDivClasses = [] | |
string CSS classes to use for the wrapping div, stored in the array keys. More... | |
int null | $revisionTimestampUsed |
Assumed rev timestamp for {{REVISIONTIMESTAMP}} if no revision is set. More... | |
string null | $revisionUsedSha1Base36 |
SHA-1 base 36 hash of any self-transclusion. More... | |
int null | $speculativePageIdUsed |
Assumed page ID for {{PAGEID}} if no revision is set. More... | |
Static Private Attributes | |
static string[] | $speculativeFields |
Definition at line 25 of file ParserOutput.php.
ParserOutput::__construct | ( | $text = '' , |
|
$languageLinks = [] , |
|||
$categoryLinks = [] , |
|||
$unused = false , |
|||
$titletext = '' |
|||
) |
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. |
array | $languageLinks | |
array | $categoryLinks | |
bool | $unused | |
string | $titletext |
Definition at line 259 of file ParserOutput.php.
ParserOutput::__sleep | ( | ) |
Definition at line 1328 of file ParserOutput.php.
ParserOutput::addCategory | ( | $c, | |
$sort | |||
) |
Definition at line 672 of file ParserOutput.php.
References $sort.
Referenced by addTrackingCategory().
ParserOutput::addExternalLink | ( | $url | ) |
Definition at line 742 of file ParserOutput.php.
References $wgRegisterInternalExternals, $wgServer, and isLinkInternal().
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.
string | $section | |
string | bool | $tag |
Definition at line 847 of file ParserOutput.php.
ParserOutput::addImage | ( | $name, | |
$timestamp = null , |
|||
$sha1 = null |
|||
) |
Register a file dependency for this output.
string | $name | Title dbKey |
string | false | null | $timestamp | MW timestamp of file creation (or false if non-existing) |
string | false | null | $sha1 | Base 36 SHA-1 of file (or false if non-existing) |
Definition at line 799 of file ParserOutput.php.
ParserOutput::addInterwikiLink | ( | $title | ) |
MWException | If given invalid input |
Definition at line 829 of file ParserOutput.php.
References $title.
Referenced by addLink().
ParserOutput::addJsConfigVars | ( | $keys, | |
$value = null |
|||
) |
Add one or more variables to be set in mw.config in JavaScript.
string | array | $keys | Key or array of key/value pairs. |
mixed | null | $value | [optional] Value of the configuration variable. |
Definition at line 876 of file ParserOutput.php.
References $keys.
Referenced by addOutputPageMetadata().
ParserOutput::addLanguageLink | ( | $t | ) |
Definition at line 696 of file ParserOutput.php.
References $t.
ParserOutput::addLink | ( | Title | $title, |
$id = null |
|||
) |
Record a local or interwiki inline link for saving in future link tables.
Title | $title | |
int | null | $id | Optional known page_id so we can skip the lookup |
Definition at line 765 of file ParserOutput.php.
References $title, addInterwikiLink(), NS_FILE, NS_MEDIA, and NS_SPECIAL.
ParserOutput::addModules | ( | $modules | ) |
Definition at line 858 of file ParserOutput.php.
References $modules.
Referenced by addOutputPageMetadata().
ParserOutput::addModuleStyles | ( | $modules | ) |
Definition at line 865 of file ParserOutput.php.
References $modules.
Referenced by addOutputPageMetadata().
ParserOutput::addOutputHook | ( | $hook, | |
$data = false |
|||
) |
Definition at line 704 of file ParserOutput.php.
ParserOutput::addOutputPageMetadata | ( | OutputPage | $out | ) |
Copy items from the OutputPage object into this one.
OutputPage | $out |
Definition at line 892 of file ParserOutput.php.
References addJsConfigVars(), addModules(), and addModuleStyles().
ParserOutput::addTemplate | ( | $title, | |
$page_id, | |||
$rev_id | |||
) |
Register a template dependency for this output.
Title | $title | |
int | $page_id | |
int | $rev_id |
Definition at line 812 of file ParserOutput.php.
References $title.
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.
Definition at line 917 of file ParserOutput.php.
References $title, addCategory(), getProperty(), Title\makeTitleSafe(), NS_CATEGORY, wfDebug(), and wfMessage().
ParserOutput::addWarning | ( | $s | ) |
Definition at line 700 of file ParserOutput.php.
References $s.
ParserOutput::addWrapperDivClass | ( | $class | ) |
Add a CSS class to use for the wrapping div.
If no class is given, no wrapper is added.
string | $class |
Definition at line 423 of file ParserOutput.php.
ParserOutput::clearWrapperDivClass | ( | ) |
Clears the CSS class to use for the wrapping div, effectively disabling the wrapper div until addWrapperDivClass() is called.
Definition at line 431 of file ParserOutput.php.
ParserOutput::finalizeAdaptiveCacheExpiry | ( | ) |
Call this when parsing is done to lower the TTL based on low parse times.
Definition at line 1308 of file ParserOutput.php.
References FAST_AR_TTL, getTimeSinceStart(), and CacheTime\updateCacheExpiry().
ParserOutput::getAllFlags | ( | ) |
Definition at line 997 of file ParserOutput.php.
& ParserOutput::getCategories | ( | ) |
Definition at line 533 of file ParserOutput.php.
References $mCategories.
Referenced by LinksUpdate\__construct(), and SpecialExpandTemplates\showHtmlPreview().
ParserOutput::getCategoryLinks | ( | ) |
Definition at line 529 of file ParserOutput.php.
Referenced by MediaWiki\Search\ParserOutputSearchDataExtractor\getCategories().
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.
Definition at line 968 of file ParserOutput.php.
References $t, and getTitleText().
ParserOutput::getEnableOOUI | ( | ) |
Definition at line 636 of file ParserOutput.php.
References $mEnableOOUI.
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.
string | $key | The key to look up. |
Definition at line 1175 of file ParserOutput.php.
& ParserOutput::getExternalLinks | ( | ) |
Definition at line 573 of file ParserOutput.php.
References $mExternalLinks.
Referenced by LinksUpdate\__construct(), and MediaWiki\Search\ParserOutputSearchDataExtractor\getExternalLinks().
& ParserOutput::getFileSearchOptions | ( | ) |
Definition at line 569 of file ParserOutput.php.
References $mFileSearchOptions.
ParserOutput::getFlag | ( | $flag | ) |
string | $flag |
Definition at line 989 of file ParserOutput.php.
Referenced by Revision\RenderedRevision\outputVariesOnRevisionMetaData(), and MediaWiki\Storage\PageEditStash\storeStashValue().
ParserOutput::getHeadItems | ( | ) |
Definition at line 585 of file ParserOutput.php.
References $mHeadItems.
ParserOutput::getHideNewSection | ( | ) |
Definition at line 716 of file ParserOutput.php.
References $mHideNewSection.
& ParserOutput::getImages | ( | ) |
Definition at line 565 of file ParserOutput.php.
References $mImages.
Referenced by LinksUpdate\__construct().
ParserOutput::getIndexPolicy | ( | ) |
Definition at line 613 of file ParserOutput.php.
References $mIndexPolicy.
ParserOutput::getIndicators | ( | ) |
ParserOutput::getInterwikiLinks | ( | ) |
Definition at line 525 of file ParserOutput.php.
References $mInterwikiLinks.
Referenced by LinksUpdate\__construct().
ParserOutput::getJsConfigVars | ( | ) |
& ParserOutput::getLanguageLinks | ( | ) |
Definition at line 521 of file ParserOutput.php.
References $mLanguageLinks.
Referenced by LinksUpdate\__construct().
ParserOutput::getLimitReportData | ( | ) |
Definition at line 628 of file ParserOutput.php.
References $mLimitReportData.
ParserOutput::getLimitReportJSData | ( | ) |
Definition at line 632 of file ParserOutput.php.
References $mLimitReportJSData.
& ParserOutput::getLinks | ( | ) |
Definition at line 553 of file ParserOutput.php.
References $mLinks.
Referenced by LinksUpdate\__construct(), and MediaWiki\Search\ParserOutputSearchDataExtractor\getOutgoingLinks().
ParserOutput::getModules | ( | ) |
Definition at line 589 of file ParserOutput.php.
References $mModules.
ParserOutput::getModuleStyles | ( | ) |
Definition at line 593 of file ParserOutput.php.
References $mModuleStyles.
ParserOutput::getNewSection | ( | ) |
Definition at line 720 of file ParserOutput.php.
References $mNewSection.
ParserOutput::getNoGallery | ( | ) |
Definition at line 581 of file ParserOutput.php.
References $mNoGallery.
ParserOutput::getOutputHooks | ( | ) |
Definition at line 605 of file ParserOutput.php.
References $mOutputHooks.
ParserOutput::getProperties | ( | ) |
Definition at line 1081 of file ParserOutput.php.
References $mProperties.
Referenced by LinksUpdate\__construct().
ParserOutput::getProperty | ( | $name | ) |
string | $name | The property name to look up. |
Definition at line 1073 of file ParserOutput.php.
Referenced by addTrackingCategory().
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.
Definition at line 290 of file ParserOutput.php.
References $mText.
Referenced by getText().
ParserOutput::getRevisionTimestampUsed | ( | ) |
Definition at line 490 of file ParserOutput.php.
References $revisionTimestampUsed.
Referenced by Revision\RenderedRevision\outputVariesOnRevisionMetaData().
ParserOutput::getRevisionUsedSha1Base36 | ( | ) |
Definition at line 517 of file ParserOutput.php.
References $revisionUsedSha1Base36.
Referenced by Revision\RenderedRevision\outputVariesOnRevisionMetaData().
ParserOutput::getSections | ( | ) |
Definition at line 549 of file ParserOutput.php.
References $mSections.
ParserOutput::getSpeculativePageIdUsed | ( | ) |
Definition at line 474 of file ParserOutput.php.
References $speculativePageIdUsed.
Referenced by Revision\RenderedRevision\outputVariesOnRevisionMetaData().
ParserOutput::getSpeculativeRevIdUsed | ( | ) |
Definition at line 458 of file ParserOutput.php.
References $mSpeculativeRevId.
Referenced by Revision\RenderedRevision\outputVariesOnRevisionMetaData().
& ParserOutput::getTemplateIds | ( | ) |
Definition at line 561 of file ParserOutput.php.
References $mTemplateIds.
& ParserOutput::getTemplates | ( | ) |
Definition at line 557 of file ParserOutput.php.
References $mTemplates.
Referenced by LinksUpdate\__construct(), and MediaWiki\Search\ParserOutputSearchDataExtractor\getTemplates().
ParserOutput::getText | ( | $options = [] | ) |
Get the output HTML.
array | $options | (since 1.31) Transformations to apply to the HTML
|
Definition at line 323 of file ParserOutput.php.
References $context, RequestContext\getMain(), getRawText(), getWrapperDivClass(), Title\newFromText(), Hooks\runWithoutAbort(), and wfUrlencode().
Referenced by Status\getHTML().
|
staticprivate |
Definition at line 1179 of file ParserOutput.php.
References wfGetRusage().
Referenced by getTimeSinceStart(), and resetParseStartTime().
array $mParseStartTime Timestamps for ParserOutput::getTimeSinceStart | ( | $clock | ) |
Returns the time since resetParseStartTime() was last called.
Clocks available are:
string | $clock |
Definition at line 1213 of file ParserOutput.php.
References getTimes().
Referenced by finalizeAdaptiveCacheExpiry().
ParserOutput::getTimestamp | ( | ) |
Definition at line 624 of file ParserOutput.php.
References $mTimestamp.
ParserOutput::getTitleText | ( | ) |
Definition at line 545 of file ParserOutput.php.
References $mTitleText.
Referenced by Article\adjustDisplayTitle(), and getDisplayTitle().
ParserOutput::getTOCHTML | ( | ) |
Definition at line 617 of file ParserOutput.php.
References $mTOCHTML.
ParserOutput::getUsedOptions | ( | ) |
Returns the options from its ParserOptions which have been taken into account to produce this output.
Definition at line 1093 of file ParserOutput.php.
Referenced by ParserCache\save().
ParserOutput::getWarnings | ( | ) |
Definition at line 609 of file ParserOutput.php.
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().
Definition at line 442 of file ParserOutput.php.
Referenced by getText().
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.
Definition at line 1275 of file ParserOutput.php.
References $wgParserCacheExpireTime, and CacheTime\getCacheExpiry().
Referenced by WikiPage\triggerOpportunisticLinksUpdate().
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.
Definition at line 278 of file ParserOutput.php.
Referenced by ParserCache\save().
ParserOutput::hideNewSection | ( | $value | ) |
Definition at line 712 of file ParserOutput.php.
|
static |
Checks, if a url is pointing to the own server.
string | $internal | The server to check against |
string | $url | The url to check |
Definition at line 731 of file ParserOutput.php.
Referenced by addExternalLink().
|
staticprivate |
Definition at line 1486 of file ParserOutput.php.
References $keys.
Referenced by mergeTrackingMetaDataFrom().
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.
ParserOutput | $source |
Definition at line 1387 of file ParserOutput.php.
References $source, mergeList(), mergeMap(), and mergeMixedList().
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.
ParserOutput | $source |
Definition at line 1351 of file ParserOutput.php.
References $source, mergeList(), mergeMap(), useEachMinValue(), useMaxValue(), and wfLogWarning().
|
staticprivate |
Definition at line 1478 of file ParserOutput.php.
Referenced by mergeHtmlMetaDataFrom(), mergeInternalMetaDataFrom(), and mergeTrackingMetaDataFrom().
|
staticprivate |
Definition at line 1482 of file ParserOutput.php.
Referenced by mergeHtmlMetaDataFrom(), mergeInternalMetaDataFrom(), and mergeTrackingMetaDataFrom().
|
staticprivate |
Definition at line 1474 of file ParserOutput.php.
Referenced by mergeHtmlMetaDataFrom().
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.
ParserOutput | $source |
Definition at line 1444 of file ParserOutput.php.
References $source, merge2D(), mergeList(), and mergeMap().
ParserOutput::preventClickjacking | ( | $flag = null | ) |
Get or set the prevent-clickjacking flag.
bool | null | $flag | New flag value, or null to leave it unchanged |
Definition at line 1288 of file ParserOutput.php.
References wfSetVar().
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().
string | $option |
Definition at line 1112 of file ParserOutput.php.
ParserOutput::resetParseStartTime | ( | ) |
Resets the parse start timestamps for future calls to getTimeSinceStart()
Definition at line 1198 of file ParserOutput.php.
References getTimes().
ParserOutput::setCategoryLinks | ( | $cl | ) |
Definition at line 648 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setDisplayTitle | ( | $text | ) |
Override the title to be used for display.
string | $text | Desired title text |
Definition at line 955 of file ParserOutput.php.
References setProperty(), and setTitleText().
ParserOutput::setEnableOOUI | ( | $enable = false | ) |
Enables OOUI, if true, in any OutputPage instance this ParserOutput object is added to.
bool | $enable | If OOUI should be enabled or not |
Definition at line 692 of file ParserOutput.php.
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:
And then later, in OutputPageParserOutput or similar:
In MediaWiki 1.20 and older, you have to use a custom member variable within the ParserOutput object:
string | $key | The 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 | $value | The value to set. Setting a value to null is equivalent to removing the value. |
Definition at line 1156 of file ParserOutput.php.
ParserOutput::setFlag | ( | $flag | ) |
Attach a flag to the output so that it can be checked later to handle special cases.
string | $flag |
Definition at line 981 of file ParserOutput.php.
ParserOutput::setIndexPolicy | ( | $policy | ) |
Definition at line 660 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setIndicator | ( | $id, | |
$content | |||
) |
string | $id | |
string | $content |
Definition at line 681 of file ParserOutput.php.
References $content.
ParserOutput::setLanguageLinks | ( | $ll | ) |
Definition at line 644 of file ParserOutput.php.
References wfSetVar().
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:
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.
string | $key | Message key |
mixed | $value | Appropriate for Message::params() |
Definition at line 1241 of file ParserOutput.php.
ParserOutput::setNewSection | ( | $value | ) |
Definition at line 708 of file ParserOutput.php.
ParserOutput::setNoGallery | ( | $value | ) |
Definition at line 577 of file ParserOutput.php.
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:
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:
And then later, in OutputPageParserOutput or similar:
In MediaWiki 1.20 and older, you have to use a custom member variable within the ParserOutput object:
string | $name | |
mixed | $value |
Definition at line 1061 of file ParserOutput.php.
Referenced by setDisplayTitle().
ParserOutput::setRevisionTimestampUsed | ( | $timestamp | ) |
string | $timestamp | TS_MW timestamp |
Definition at line 482 of file ParserOutput.php.
ParserOutput::setRevisionUsedSha1Base36 | ( | $hash | ) |
string | $hash | Lowercase SHA-1 base 36 hash |
Definition at line 498 of file ParserOutput.php.
ParserOutput::setSections | ( | $toc | ) |
Definition at line 656 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setSpeculativePageIdUsed | ( | $id | ) |
ParserOutput::setSpeculativeRevIdUsed | ( | $id | ) |
ParserOutput::setText | ( | $text | ) |
Definition at line 640 of file ParserOutput.php.
References wfSetVar().
Referenced by JsonContent\fillParserOutput(), WikitextContent\fillParserOutput(), TablePager\getBodyOutput(), and TablePager\getFullOutput().
ParserOutput::setTimestamp | ( | $timestamp | ) |
Definition at line 668 of file ParserOutput.php.
References wfSetVar().
Referenced by ParserCache\save().
ParserOutput::setTitleText | ( | $t | ) |
Definition at line 652 of file ParserOutput.php.
References $t, and wfSetVar().
Referenced by setDisplayTitle().
ParserOutput::setTOCHTML | ( | $tochtml | ) |
Definition at line 664 of file ParserOutput.php.
References wfSetVar().
ParserOutput::unsetProperty | ( | $name | ) |
Definition at line 1077 of file ParserOutput.php.
ParserOutput::updateRuntimeAdaptiveExpiry | ( | $ttl | ) |
Lower the runtime adaptive TTL to at most this value.
int | $ttl |
Definition at line 1298 of file ParserOutput.php.
References CacheTime\updateCacheExpiry().
|
staticprivate |
Definition at line 1505 of file ParserOutput.php.
References $keys, and useMinValue().
Referenced by mergeInternalMetaDataFrom().
|
staticprivate |
Definition at line 1532 of file ParserOutput.php.
Referenced by mergeInternalMetaDataFrom().
|
staticprivate |
Definition at line 1520 of file ParserOutput.php.
Referenced by useEachMinValue().
|
private |
Definition at line 183 of file ParserOutput.php.
ParserOutput::$mCategories |
Definition at line 53 of file ParserOutput.php.
Referenced by getCategories().
ParserOutput::$mEnableOOUI = false |
Definition at line 173 of file ParserOutput.php.
Referenced by getEnableOOUI().
|
private |
Definition at line 188 of file ParserOutput.php.
ParserOutput::$mExternalLinks = [] |
Definition at line 96 of file ParserOutput.php.
Referenced by getExternalLinks().
ParserOutput::$mFileSearchOptions = [] |
Definition at line 91 of file ParserOutput.php.
Referenced by getFileSearchOptions().
|
private |
Definition at line 211 of file ParserOutput.php.
ParserOutput::$mHeadItems = [] |
Definition at line 122 of file ParserOutput.php.
Referenced by getHeadItems().
ParserOutput::$mHideNewSection = false |
Definition at line 112 of file ParserOutput.php.
Referenced by getHideNewSection().
ParserOutput::$mImages = [] |
Definition at line 86 of file ParserOutput.php.
Referenced by getImages().
|
private |
Definition at line 178 of file ParserOutput.php.
Referenced by getIndexPolicy().
ParserOutput::$mIndicators = [] |
Definition at line 58 of file ParserOutput.php.
Referenced by getIndicators().
ParserOutput::$mInterwikiLinks = [] |
Definition at line 102 of file ParserOutput.php.
Referenced by getInterwikiLinks().
ParserOutput::$mJsConfigVars = [] |
Definition at line 137 of file ParserOutput.php.
Referenced by getJsConfigVars().
ParserOutput::$mLanguageLinks |
Definition at line 48 of file ParserOutput.php.
Referenced by getLanguageLinks().
|
private |
Definition at line 193 of file ParserOutput.php.
Referenced by getLimitReportData().
|
private |
Parser limit report data for JSON.
Definition at line 196 of file ParserOutput.php.
Referenced by getLimitReportJSData().
ParserOutput::$mLinks = [] |
Definition at line 69 of file ParserOutput.php.
Referenced by getLinks().
|
private |
Upper bound of expiry based on parse duration.
Definition at line 236 of file ParserOutput.php.
ParserOutput::$mModules = [] |
Definition at line 127 of file ParserOutput.php.
Referenced by getModules().
ParserOutput::$mModuleStyles = [] |
Definition at line 132 of file ParserOutput.php.
Referenced by getModuleStyles().
ParserOutput::$mNewSection = false |
Definition at line 107 of file ParserOutput.php.
Referenced by getNewSection().
ParserOutput::$mNoGallery = false |
Definition at line 117 of file ParserOutput.php.
Referenced by getNoGallery().
ParserOutput::$mOutputHooks = [] |
Definition at line 142 of file ParserOutput.php.
Referenced by getOutputHooks().
|
private |
Definition at line 201 of file ParserOutput.php.
|
private |
Definition at line 206 of file ParserOutput.php.
ParserOutput::$mProperties = [] |
Definition at line 158 of file ParserOutput.php.
Referenced by getProperties().
ParserOutput::$mSections = [] |
Definition at line 153 of file ParserOutput.php.
Referenced by getSections().
|
private |
Assumed rev ID for {{REVISIONID}} if no revision is set.
Definition at line 221 of file ParserOutput.php.
Referenced by getSpeculativeRevIdUsed().
ParserOutput::$mTemplateIds = [] |
Definition at line 81 of file ParserOutput.php.
Referenced by getTemplateIds().
ParserOutput::$mTemplates = [] |
Definition at line 75 of file ParserOutput.php.
Referenced by getTemplates().
ParserOutput::$mText = null |
Definition at line 42 of file ParserOutput.php.
Referenced by getRawText().
ParserOutput::$mTimestamp |
Definition at line 168 of file ParserOutput.php.
Referenced by getTimestamp().
ParserOutput::$mTitleText |
Definition at line 63 of file ParserOutput.php.
Referenced by getTitleText().
ParserOutput::$mTOCHTML = '' |
Definition at line 163 of file ParserOutput.php.
Referenced by getTOCHTML().
ParserOutput::$mWarnings = [] |
Definition at line 148 of file ParserOutput.php.
|
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 233 of file ParserOutput.php.
|
private |
Assumed rev timestamp for {{REVISIONTIMESTAMP}} if no revision is set.
Definition at line 225 of file ParserOutput.php.
Referenced by getRevisionTimestampUsed().
|
private |
SHA-1 base 36 hash of any self-transclusion.
Definition at line 228 of file ParserOutput.php.
Referenced by getRevisionUsedSha1Base36().
|
staticprivate |
Definition at line 214 of file ParserOutput.php.
|
private |
Assumed page ID for {{PAGEID}} if no revision is set.
Definition at line 223 of file ParserOutput.php.
Referenced by getSpeculativePageIdUsed().
const ParserOutput::EDITSECTION_REGEX |
Definition at line 238 of file ParserOutput.php.
const ParserOutput::FAST_AR_TTL = 60 |
Definition at line 246 of file ParserOutput.php.
Referenced by finalizeAdaptiveCacheExpiry().
const ParserOutput::MIN_AR_TTL = 15 |
Definition at line 248 of file ParserOutput.php.
const ParserOutput::PARSE_FAST_SEC = 0.100 |
Definition at line 244 of file ParserOutput.php.
const ParserOutput::PARSE_SLOW_SEC = 1.0 |
Definition at line 245 of file ParserOutput.php.
const ParserOutput::SLOW_AR_TTL = 3600 |
Definition at line 247 of file ParserOutput.php.
const ParserOutput::SUPPORTS_STATELESS_TRANSFORMS = 1 |
Feature flags to indicate to extensions that MediaWiki core supports and uses getText() stateless transforms.
Definition at line 32 of file ParserOutput.php.
const ParserOutput::SUPPORTS_UNWRAP_TRANSFORM = 1 |
Definition at line 37 of file ParserOutput.php.