[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/parser/ -> ParserOutput.php (summary)

(no description)

File Size: 818 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ParserOutput:: (80 methods):
  __construct()
  getText()
  getLanguageLinks()
  getInterwikiLinks()
  getCategoryLinks()
  getCategories()
  getTitleText()
  getSections()
  getEditSectionTokens()
  getLinks()
  getTemplates()
  getTemplateIds()
  getImages()
  getFileSearchOptions()
  getExternalLinks()
  getNoGallery()
  getHeadItems()
  getModules()
  getModuleScripts()
  getModuleStyles()
  getModuleMessages()
  getJsConfigVars()
  getOutputHooks()
  getWarnings()
  getIndexPolicy()
  getTOCHTML()
  getTimestamp()
  getLimitReportData()
  getTOCEnabled()
  setText()
  setLanguageLinks()
  setCategoryLinks()
  setTitleText()
  setSections()
  setEditSectionTokens()
  setIndexPolicy()
  setTOCHTML()
  setTimestamp()
  setTOCEnabled()
  addCategory()
  addLanguageLink()
  addWarning()
  addOutputHook()
  setNewSection()
  hideNewSection()
  getHideNewSection()
  getNewSection()
  isLinkInternal()
  addExternalLink()
  addLink()
  addImage()
  addTemplate()
  addInterwikiLink()
  addHeadItem()
  addModules()
  addModuleScripts()
  addModuleStyles()
  addModuleMessages()
  addJsConfigVars()
  addOutputPageMetadata()
  setDisplayTitle()
  getDisplayTitle()
  setFlag()
  getFlag()
  setProperty()
  getProperty()
  unsetProperty()
  getProperties()
  getUsedOptions()
  recordOption()
  addSecondaryDataUpdate()
  getSecondaryDataUpdates()
  setExtensionData()
  getExtensionData()
  getTimes()
  resetParseStartTime()
  getTimeSinceStart()
  setLimitReportData()
  preventClickjacking()
  __sleep()


Class: ParserOutput  - X-Ref

Output of the PHP parser.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
http://www.gnu.org/copyleft/gpl.html

__construct( $text = '', $languageLinks = array()   X-Ref
No description

getText()   X-Ref
No description

getLanguageLinks()   X-Ref
No description

getInterwikiLinks()   X-Ref
No description

getCategoryLinks()   X-Ref
No description

getCategories()   X-Ref
No description

getTitleText()   X-Ref
No description

getSections()   X-Ref
No description

getEditSectionTokens()   X-Ref
No description

getLinks()   X-Ref
No description

getTemplates()   X-Ref
No description

getTemplateIds()   X-Ref
No description

getImages()   X-Ref
No description

getFileSearchOptions()   X-Ref
No description

getExternalLinks()   X-Ref
No description

getNoGallery()   X-Ref
No description

getHeadItems()   X-Ref
No description

getModules()   X-Ref
No description

getModuleScripts()   X-Ref
No description

getModuleStyles()   X-Ref
No description

getModuleMessages()   X-Ref
No description

getJsConfigVars()   X-Ref
No description

getOutputHooks()   X-Ref
No description

getWarnings()   X-Ref
No description

getIndexPolicy()   X-Ref
No description

getTOCHTML()   X-Ref
No description

getTimestamp()   X-Ref
No description

getLimitReportData()   X-Ref
No description

getTOCEnabled()   X-Ref
No description

setText( $text )   X-Ref
No description

setLanguageLinks( $ll )   X-Ref
No description

setCategoryLinks( $cl )   X-Ref
No description

setTitleText( $t )   X-Ref
No description

setSections( $toc )   X-Ref
No description

setEditSectionTokens( $t )   X-Ref
No description

setIndexPolicy( $policy )   X-Ref
No description

setTOCHTML( $tochtml )   X-Ref
No description

setTimestamp( $timestamp )   X-Ref
No description

setTOCEnabled( $flag )   X-Ref
No description

addCategory( $c, $sort )   X-Ref
No description

addLanguageLink( $t )   X-Ref
No description

addWarning( $s )   X-Ref
No description

addOutputHook( $hook, $data = false )   X-Ref
No description

setNewSection( $value )   X-Ref
No description

hideNewSection( $value )   X-Ref
No description

getHideNewSection()   X-Ref
No description

getNewSection()   X-Ref
No description

isLinkInternal( $internal, $url )   X-Ref
Checks, if a url is pointing to the own server

param: string $internal The server to check against
param: string $url The url to check
return: bool

addExternalLink( $url )   X-Ref
No description

addLink( Title $title, $id = null )   X-Ref
Record a local or interwiki inline link for saving in future link tables.

param: Title $title
param: int|null $id Optional known page_id so we can skip the lookup

addImage( $name, $timestamp = null, $sha1 = null )   X-Ref
Register a file dependency for this output

param: string $name Title dbKey
param: string $timestamp MW timestamp of file creation (or false if non-existing)
param: string $sha1 Base 36 SHA-1 of file (or false if non-existing)
return: void

addTemplate( $title, $page_id, $rev_id )   X-Ref
Register a template dependency for this output

param: Title $title
param: int $page_id
param: int $rev_id
return: void

addInterwikiLink( $title )   X-Ref

param: Title $title Title object, must be an interwiki link

addHeadItem( $section, $tag = false )   X-Ref
Add some text to the "<head>".
If $tag is set, the section with that tag will only be included once
in a given page.

param: string $section
param: string|bool $tag

addModules( $modules )   X-Ref
No description

addModuleScripts( $modules )   X-Ref
No description

addModuleStyles( $modules )   X-Ref
No description

addModuleMessages( $modules )   X-Ref
No description

addJsConfigVars( $keys, $value = null )   X-Ref
Add one or more variables to be set in mw.config in JavaScript.

param: string|array $keys Key or array of key/value pairs.
param: mixed $value [optional] Value of the configuration variable.

addOutputPageMetadata( OutputPage $out )   X-Ref
Copy items from the OutputPage object into this one

param: OutputPage $out

setDisplayTitle( $text )   X-Ref
Override the title to be used for display
-- this is assumed to have been validated
(check equal normalisation, etc.)

param: string $text Desired title text

getDisplayTitle()   X-Ref
Get the title to be used for display

return: string

setFlag( $flag )   X-Ref
Fairly generic flag setter thingy.

param: string $flag

getFlag( $flag )   X-Ref
No description

setProperty( $name, $value )   X-Ref
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.

getProperty( $name )   X-Ref

param: string $name The property name to look up.
return: mixed|bool The value previously set using setProperty(). False if null or no value

unsetProperty( $name )   X-Ref
No description

getProperties()   X-Ref
No description

getUsedOptions()   X-Ref
Returns the options from its ParserOptions which have been taken
into account to produce this output or false if not available.

return: array

recordOption( $option )   X-Ref
Tags a parser option for use in the cache key for this parser output.
Registered as a watcher at ParserOptions::registerWatcher() by Parser::clearState().

param: string $option

addSecondaryDataUpdate( DataUpdate $update )   X-Ref
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.

param: DataUpdate $update

getSecondaryDataUpdates( Title $title = null, $recursive = true )   X-Ref
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.

param: Title $title The title of the page we're updating. If not given, a title object will
param: bool $recursive Queue jobs for recursive updates?
return: array An array of instances of DataUpdate

setExtensionData( $key, $value )   X-Ref
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:

param: string $key The key for accessing the data. Extensions should take care to avoid
param: mixed $value The value to set. Setting a value to null is equivalent to removing

getExtensionData( $key )   X-Ref
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.

param: string $key The key to look up.
return: mixed|null The value previously set for the given key using setExtensionData()

getTimes( $clock = null )   X-Ref
No description

resetParseStartTime()   X-Ref
Resets the parse start timestamps for future calls to getTimeSinceStart()


getTimeSinceStart( $clock )   X-Ref
Returns the time since resetParseStartTime() was last called

Clocks available are:
- wall: Wall clock time
- cpu: CPU time (requires getrusage)

param: string $clock
return: float|null

setLimitReportData( $key, $value )   X-Ref
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.

param: string $key Message key
param: mixed $value Appropriate for Message::params()

preventClickjacking( $flag = null )   X-Ref
Get or set the prevent-clickjacking flag

param: bool|null $flag New flag value, or null to leave it unchanged
return: bool Old flag value

__sleep()   X-Ref
Save space for for serialization by removing useless values

return: array



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1