MediaWiki
1.23.2
|
Public Member Functions | |
__construct ( $text='', $languageLinks=array(), $categoryLinks=array(), $containsOldMagic=false, $titletext='') | |
__sleep () | |
Save space for for serialization by removing useless values. More... | |
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... | |
addModuleMessages ( $modules) | |
addModules ( $modules) | |
addModuleScripts ( $modules) | |
addModuleStyles ( $modules) | |
addOutputHook ( $hook, $data=false) | |
addOutputPageMetadata (OutputPage $out) | |
Copy items from the OutputPage object into this one. More... | |
addSecondaryDataUpdate (DataUpdate $update) | |
Adds an update job to the output. More... | |
addTemplate ( $title, $page_id, $rev_id) | |
Register a template dependency for this output. More... | |
addWarning ( $s) | |
& | getCategories () |
getCategoryLinks () | |
getDisplayTitle () | |
Get the title to be used for display. More... | |
getEditSectionTokens () | |
getExtensionData ( $key) | |
Gets extensions data previously attached to this ParserOutput using setExtensionData(). More... | |
& | getExternalLinks () |
& | getFileSearchOptions () |
getFlag ( $flag) | |
getHeadItems () | |
getHideNewSection () | |
& | getImages () |
getIndexPolicy () | |
getInterwikiLinks () | |
getJsConfigVars () | |
& | getLanguageLinks () |
getLimitReportData () | |
& | getLinks () |
getModuleMessages () | |
getModules () | |
getModuleScripts () | |
getModuleStyles () | |
getNewSection () | |
getNoGallery () | |
getOutputHooks () | |
getProperties () | |
getProperty ( $name) | |
getSecondaryDataUpdates (Title $title=null, $recursive=true) | |
Returns any DataUpdate jobs to be executed in order to store secondary information extracted from the page's content, including a LinksUpdate object for all links stored in this ParserOutput object. More... | |
getSections () | |
& | getTemplateIds () |
& | getTemplates () |
getText () | |
getTimeSinceStart ( $clock) | |
Returns the time since resetParseStartTime() was last called. More... | |
getTimestamp () | |
getTitleText () | |
getTOCEnabled () | |
getTOCHTML () | |
getUsedOptions () | |
Returns the options from its ParserOptions which have been taken into account to produce this output or false if not available. More... | |
getWarnings () | |
hideNewSection ( $value) | |
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... | |
replaceEditSectionLinksCallback ( $m) | |
callback used by getText to replace editsection tokens 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 – this is assumed to have been validated (check equal normalisation, etc.) More... | |
setEditSectionTokens ( $t) | |
setExtensionData ( $key, $value) | |
Attaches arbitrary data to this ParserObject. More... | |
setFlag ( $flag) | |
Fairly generic flag setter thingy. More... | |
setIndexPolicy ( $policy) | |
setLanguageLinks ( $ll) | |
setLimitReportData ( $key, $value) | |
Sets parser limit report data for a key. More... | |
setNewSection ( $value) | |
setProperty ( $name, $value) | |
Set a property to be stored in the page_props database table. More... | |
setSections ( $toc) | |
setText ( $text) | |
setTimestamp ( $timestamp) | |
setTitleText ( $t) | |
setTOCEnabled ( $flag) | |
setTOCHTML ( $tochtml) | |
Public Member Functions inherited from CacheTime | |
containsOldMagic () | |
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... | |
setContainsOldMagic ( $com) | |
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... | |
Static Private Member Functions | |
static | getTimes ( $clock=null) |
Private Attributes | |
$mAccessedOptions = array() | |
$mExtensionData = array() | |
$mIndexPolicy = '' | |
$mLimitReportData = array() | |
$mParseStartTime = array() | |
$mPreventClickjacking = false | |
$mSecondaryDataUpdates = array() | |
Definition at line 24 of file ParserOutput.php.
ParserOutput::__construct | ( | $text = '' , |
|
$languageLinks = array() , |
|||
$categoryLinks = array() , |
|||
$containsOldMagic = false , |
|||
$titletext = '' |
|||
) |
Definition at line 63 of file ParserOutput.php.
ParserOutput::__sleep | ( | ) |
Save space for for serialization by removing useless values.
Definition at line 678 of file ParserOutput.php.
References array().
ParserOutput::addCategory | ( | $c, | |
$sort | |||
) |
Definition at line 161 of file ParserOutput.php.
References $sort.
ParserOutput::addExternalLink | ( | $url | ) |
Definition at line 200 of file ParserOutput.php.
References global.
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.
Definition at line 301 of file ParserOutput.php.
References $section.
ParserOutput::addImage | ( | $name, | |
$timestamp = null , |
|||
$sha1 = null |
|||
) |
Register a file dependency for this output.
string | $name | Title dbKey |
string | $timestamp | MW timestamp of file creation (or false if non-existing) |
string | $sha1 | base 36 SHA-1 of file (or false if non-existing) |
Definition at line 254 of file ParserOutput.php.
References $name, $timestamp, and array().
ParserOutput::addInterwikiLink | ( | $title | ) |
$title | Title object, must be an interwiki link |
MWException | if given invalid input |
Definition at line 285 of file ParserOutput.php.
ParserOutput::addJsConfigVars | ( | $keys, | |
$value = null |
|||
) |
Add one or more variables to be set in mw.config in JavaScript.
$keys | {String|Array} Key or array of key/value pairs. |
$value | {Mixed} [optional] Value of the configuration variable. |
Definition at line 332 of file ParserOutput.php.
ParserOutput::addLanguageLink | ( | $t | ) |
Definition at line 162 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 object |
$id | Mixed: optional known page_id so we can skip the lookup |
Definition at line 219 of file ParserOutput.php.
References $title, array(), NS_FILE, NS_MEDIA, and NS_SPECIAL.
ParserOutput::addModuleMessages | ( | $modules | ) |
Definition at line 321 of file ParserOutput.php.
References array().
ParserOutput::addModules | ( | $modules | ) |
Definition at line 309 of file ParserOutput.php.
References array().
ParserOutput::addModuleScripts | ( | $modules | ) |
Definition at line 313 of file ParserOutput.php.
References array().
ParserOutput::addModuleStyles | ( | $modules | ) |
Definition at line 317 of file ParserOutput.php.
References array().
ParserOutput::addOutputHook | ( | $hook, | |
$data = false |
|||
) |
Definition at line 165 of file ParserOutput.php.
References array().
ParserOutput::addOutputPageMetadata | ( | OutputPage | $out | ) |
Copy items from the OutputPage object into this one.
$out | OutputPage object |
Definition at line 348 of file ParserOutput.php.
References $out.
ParserOutput::addSecondaryDataUpdate | ( | DataUpdate | $update | ) |
Adds an update job to the output.
Any update jobs added to the output will eventually be executed in order to store any secondary information extracted from the page's content. This is triggered by calling getSecondaryDataUpdates() and is used for forward links updates on edit and backlink updates by jobs.
DataUpdate | $update |
Definition at line 502 of file ParserOutput.php.
ParserOutput::addTemplate | ( | $title, | |
$page_id, | |||
$rev_id | |||
) |
Register a template dependency for this output.
$title | Title |
$page_id | |
$rev_id |
Definition at line 268 of file ParserOutput.php.
ParserOutput::addWarning | ( | $s | ) |
Definition at line 163 of file ParserOutput.php.
References $s.
& ParserOutput::getCategories | ( | ) |
Definition at line 123 of file ParserOutput.php.
ParserOutput::getCategoryLinks | ( | ) |
Definition at line 122 of file ParserOutput.php.
ParserOutput::getDisplayTitle | ( | ) |
Get the title to be used for display.
Definition at line 376 of file ParserOutput.php.
References $t.
ParserOutput::getEditSectionTokens | ( | ) |
Definition at line 126 of file ParserOutput.php.
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 592 of file ParserOutput.php.
& ParserOutput::getExternalLinks | ( | ) |
Definition at line 132 of file ParserOutput.php.
& ParserOutput::getFileSearchOptions | ( | ) |
Definition at line 131 of file ParserOutput.php.
ParserOutput::getFlag | ( | $flag | ) |
Definition at line 391 of file ParserOutput.php.
ParserOutput::getHeadItems | ( | ) |
Definition at line 134 of file ParserOutput.php.
ParserOutput::getHideNewSection | ( | ) |
Definition at line 175 of file ParserOutput.php.
& ParserOutput::getImages | ( | ) |
Definition at line 130 of file ParserOutput.php.
Referenced by WikiPage\doCascadeProtectionUpdates().
ParserOutput::getIndexPolicy | ( | ) |
Definition at line 143 of file ParserOutput.php.
ParserOutput::getInterwikiLinks | ( | ) |
Definition at line 121 of file ParserOutput.php.
ParserOutput::getJsConfigVars | ( | ) |
Definition at line 140 of file ParserOutput.php.
& ParserOutput::getLanguageLinks | ( | ) |
Definition at line 120 of file ParserOutput.php.
ParserOutput::getLimitReportData | ( | ) |
Definition at line 146 of file ParserOutput.php.
& ParserOutput::getLinks | ( | ) |
Definition at line 127 of file ParserOutput.php.
ParserOutput::getModuleMessages | ( | ) |
Definition at line 138 of file ParserOutput.php.
ParserOutput::getModules | ( | ) |
Definition at line 135 of file ParserOutput.php.
ParserOutput::getModuleScripts | ( | ) |
Definition at line 136 of file ParserOutput.php.
ParserOutput::getModuleStyles | ( | ) |
Definition at line 137 of file ParserOutput.php.
ParserOutput::getNewSection | ( | ) |
Definition at line 178 of file ParserOutput.php.
ParserOutput::getNoGallery | ( | ) |
Definition at line 133 of file ParserOutput.php.
ParserOutput::getOutputHooks | ( | ) |
Definition at line 141 of file ParserOutput.php.
References array().
ParserOutput::getProperties | ( | ) |
Definition at line 460 of file ParserOutput.php.
References array().
ParserOutput::getProperty | ( | $name | ) |
Definition at line 456 of file ParserOutput.php.
References $name.
Returns any DataUpdate jobs to be executed in order to store secondary information extracted from the page's content, including a LinksUpdate object for all links stored in this ParserOutput object.
$title | Title The title of the page we're updating. If not given, a title object will be created based on $this->getTitleText() |
$recursive | Boolean: queue jobs for recursive updates? |
Definition at line 522 of file ParserOutput.php.
References $linksUpdate, $title, array(), and Title\newFromText().
ParserOutput::getSections | ( | ) |
Definition at line 125 of file ParserOutput.php.
& ParserOutput::getTemplateIds | ( | ) |
Definition at line 129 of file ParserOutput.php.
& ParserOutput::getTemplates | ( | ) |
Definition at line 128 of file ParserOutput.php.
Referenced by WikiPage\doCascadeProtectionUpdates().
ParserOutput::getText | ( | ) |
Definition at line 73 of file ParserOutput.php.
References array().
|
staticprivate |
Definition at line 600 of file ParserOutput.php.
ParserOutput::getTimeSinceStart | ( | $clock | ) |
Returns the time since resetParseStartTime() was last called.
Clocks available are:
string | $clock |
Definition at line 632 of file ParserOutput.php.
ParserOutput::getTimestamp | ( | ) |
Definition at line 145 of file ParserOutput.php.
ParserOutput::getTitleText | ( | ) |
Definition at line 124 of file ParserOutput.php.
Referenced by Article\adjustDisplayTitle().
ParserOutput::getTOCEnabled | ( | ) |
Definition at line 147 of file ParserOutput.php.
ParserOutput::getTOCHTML | ( | ) |
Definition at line 144 of file ParserOutput.php.
ParserOutput::getUsedOptions | ( | ) |
Returns the options from its ParserOptions which have been taken into account to produce this output or false if not available.
Definition at line 472 of file ParserOutput.php.
References array().
ParserOutput::getWarnings | ( | ) |
Definition at line 142 of file ParserOutput.php.
ParserOutput::hideNewSection | ( | $value | ) |
Definition at line 172 of file ParserOutput.php.
References $value.
|
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 189 of file ParserOutput.php.
References check, https, in, is(), of, query, and server.
Referenced by ParserOutputTest\testIsLinkInternal().
ParserOutput::preventClickjacking | ( | $flag = null | ) |
Get or set the prevent-clickjacking flag.
boolean | null | $flag | New flag value, or null to leave it unchanged |
Definition at line 671 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().
Definition at line 488 of file ParserOutput.php.
ParserOutput::replaceEditSectionLinksCallback | ( | $m | ) |
callback used by getText to replace editsection tokens
$m |
MWException |
Definition at line 104 of file ParserOutput.php.
References $args, $skin, $wgLang, $wgOut, array(), global, and Title\newFromText().
ParserOutput::resetParseStartTime | ( | ) |
Resets the parse start timestamps for future calls to getTimeSinceStart()
Definition at line 617 of file ParserOutput.php.
ParserOutput::setCategoryLinks | ( | $cl | ) |
Definition at line 151 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setDisplayTitle | ( | $text | ) |
Override the title to be used for display – this is assumed to have been validated (check equal normalisation, etc.)
string | $text | desired title text |
Definition at line 366 of file ParserOutput.php.
ParserOutput::setEditSectionTokens | ( | $t | ) |
Definition at line 155 of file ParserOutput.php.
References $t, and wfSetVar().
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 573 of file ParserOutput.php.
References $value.
ParserOutput::setFlag | ( | $flag | ) |
Fairly generic flag setter thingy.
Definition at line 387 of file ParserOutput.php.
ParserOutput::setIndexPolicy | ( | $policy | ) |
Definition at line 156 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setLanguageLinks | ( | $ll | ) |
Definition at line 150 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 660 of file ParserOutput.php.
References $value.
ParserOutput::setNewSection | ( | $value | ) |
Definition at line 169 of file ParserOutput.php.
References $value.
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.
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:
Definition at line 452 of file ParserOutput.php.
ParserOutput::setSections | ( | $toc | ) |
Definition at line 154 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setText | ( | $text | ) |
Definition at line 149 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setTimestamp | ( | $timestamp | ) |
Definition at line 158 of file ParserOutput.php.
References $timestamp, and wfSetVar().
ParserOutput::setTitleText | ( | $t | ) |
Definition at line 153 of file ParserOutput.php.
References $t, and wfSetVar().
ParserOutput::setTOCEnabled | ( | $flag | ) |
Definition at line 159 of file ParserOutput.php.
References wfSetVar().
ParserOutput::setTOCHTML | ( | $tochtml | ) |
Definition at line 157 of file ParserOutput.php.
References wfSetVar().
|
private |
Definition at line 54 of file ParserOutput.php.
ParserOutput::$mCategories |
Definition at line 25 of file ParserOutput.php.
ParserOutput::$mEditSectionTokens = false |
Definition at line 48 of file ParserOutput.php.
|
private |
Definition at line 56 of file ParserOutput.php.
ParserOutput::$mExternalLinks = array() |
Definition at line 34 of file ParserOutput.php.
ParserOutput::$mFileSearchOptions = array() |
Definition at line 33 of file ParserOutput.php.
ParserOutput::$mHeadItems = array() |
Definition at line 39 of file ParserOutput.php.
ParserOutput::$mHideNewSection = false |
Definition at line 37 of file ParserOutput.php.
ParserOutput::$mImages = array() |
Definition at line 32 of file ParserOutput.php.
|
private |
Definition at line 53 of file ParserOutput.php.
ParserOutput::$mInterwikiLinks = array() |
Definition at line 35 of file ParserOutput.php.
ParserOutput::$mJsConfigVars = array() |
Definition at line 44 of file ParserOutput.php.
ParserOutput::$mLanguageLinks |
Definition at line 25 of file ParserOutput.php.
|
private |
Definition at line 57 of file ParserOutput.php.
ParserOutput::$mLinks = array() |
Definition at line 29 of file ParserOutput.php.
ParserOutput::$mModuleMessages = array() |
Definition at line 43 of file ParserOutput.php.
ParserOutput::$mModules = array() |
Definition at line 40 of file ParserOutput.php.
ParserOutput::$mModuleScripts = array() |
Definition at line 41 of file ParserOutput.php.
ParserOutput::$mModuleStyles = array() |
Definition at line 42 of file ParserOutput.php.
ParserOutput::$mNewSection = false |
Definition at line 36 of file ParserOutput.php.
ParserOutput::$mNoGallery = false |
Definition at line 38 of file ParserOutput.php.
ParserOutput::$mOutputHooks = array() |
Definition at line 45 of file ParserOutput.php.
|
private |
Definition at line 58 of file ParserOutput.php.
|
private |
Definition at line 59 of file ParserOutput.php.
ParserOutput::$mProperties = array() |
Definition at line 49 of file ParserOutput.php.
|
private |
Definition at line 55 of file ParserOutput.php.
ParserOutput::$mSections = array() |
Definition at line 47 of file ParserOutput.php.
ParserOutput::$mTemplateIds = array() |
Definition at line 31 of file ParserOutput.php.
ParserOutput::$mTemplates = array() |
Definition at line 30 of file ParserOutput.php.
ParserOutput::$mText |
Definition at line 25 of file ParserOutput.php.
ParserOutput::$mTimestamp |
Definition at line 50 of file ParserOutput.php.
ParserOutput::$mTitleText |
Definition at line 25 of file ParserOutput.php.
ParserOutput::$mTOCEnabled = true |
Definition at line 52 of file ParserOutput.php.
ParserOutput::$mTOCHTML = '' |
Definition at line 50 of file ParserOutput.php.
ParserOutput::$mWarnings = array() |
Definition at line 46 of file ParserOutput.php.
const ParserOutput::EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#' |
Definition at line 61 of file ParserOutput.php.
Referenced by MWTidyWrapper\getWrapped().