MediaWiki  REL1_31
PPFrame Interface Reference
Inheritance diagram for PPFrame:

Public Member Functions

 cachedExpand ( $key, $root, $flags=0)
 Expand a document tree node, caching the result on its parent with the given key. More...
 
 expand ( $root, $flags=0)
 Expand a document tree node. More...
 
 getArgument ( $name)
 Get an argument to this frame by name. More...
 
 getArguments ()
 Returns all arguments of this frame. More...
 
 getNamedArguments ()
 Returns all named arguments of this frame. More...
 
 getNumberedArguments ()
 Returns all numbered arguments of this frame. More...
 
 getTitle ()
 Get a title of frame. More...
 
 getTTL ()
 Get the TTL of the frame's output. More...
 
 implode ( $sep)
 Implode with no flags specified. More...
 
 implodeWithFlags ( $sep, $flags)
 Implode with flags for expand() More...
 
 isEmpty ()
 Returns true if there are no arguments in this frame. More...
 
 isTemplate ()
 Return true if the frame is a template frame. More...
 
 isVolatile ()
 Get the "volatile" flag. More...
 
 loopCheck ( $title)
 Returns true if the infinite loop check is OK, false if a loop is detected. More...
 
 newChild ( $args=false, $title=false, $indexOffset=0)
 Create a child frame. More...
 
 setTTL ( $ttl)
 Set the TTL of the output of this frame and all of its ancestors. More...
 
 setVolatile ( $flag=true)
 Set the "volatile" flag. More...
 
 virtualBracketedImplode ( $start, $sep, $end)
 Virtual implode with brackets. More...
 
 virtualImplode ( $sep)
 Makes an object that, when expand()ed, will be the same as one obtained with implode() More...
 

Public Attributes

const NO_ARGS = 1
 
const NO_IGNORE = 8
 
const NO_TAGS = 32
 
const NO_TEMPLATES = 2
 
const RECOVER_COMMENTS = 16
 
const RECOVER_ORIG = 59
 
const STRIP_COMMENTS = 4
 
const SUPPORTS_INDEX_OFFSET = 1
 This constant exists when $indexOffset is supported in newChild() More...
 

Detailed Description

Definition at line 166 of file Preprocessor.php.

Member Function Documentation

◆ cachedExpand()

PPFrame::cachedExpand (   $key,
  $root,
  $flags = 0 
)

Expand a document tree node, caching the result on its parent with the given key.

Parameters
string | int$key
string | PPNode$root
int$flags
Returns
string

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ expand()

PPFrame::expand (   $root,
  $flags = 0 
)

Expand a document tree node.

Parameters
string | PPNode$root
int$flags
Returns
string

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ getArgument()

PPFrame::getArgument (   $name)

Get an argument to this frame by name.

Parameters
int | string$name
Returns
string|bool

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, PPFrame_DOM, PPCustomFrame_Hash, and PPCustomFrame_DOM.

◆ getArguments()

PPFrame::getArguments ( )

Returns all arguments of this frame.

Returns
array

Implemented in PPCustomFrame_Hash, PPTemplateFrame_Hash, PPFrame_Hash, PPCustomFrame_DOM, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ getNamedArguments()

PPFrame::getNamedArguments ( )

Returns all named arguments of this frame.

Returns
array

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ getNumberedArguments()

PPFrame::getNumberedArguments ( )

Returns all numbered arguments of this frame.

Returns
array

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ getTitle()

PPFrame::getTitle ( )

Get a title of frame.

Returns
Title

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ getTTL()

PPFrame::getTTL ( )

Get the TTL of the frame's output.

This is the maximum amount of time, in seconds, that this frame's output should be cached for. A value of null indicates that no maximum has been specified.

Note that this TTL only applies to caching frames as parts of pages. It is not relevant to caching the entire rendered output of a page.

Returns
int|null

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ implode()

PPFrame::implode (   $sep)

Implode with no flags specified.

Parameters
string$sep
string | PPNode$args,...
Returns
string

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ implodeWithFlags()

PPFrame::implodeWithFlags (   $sep,
  $flags 
)

Implode with flags for expand()

Parameters
string$sep
int$flags
string | PPNode$args,...
Returns
string

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ isEmpty()

PPFrame::isEmpty ( )

Returns true if there are no arguments in this frame.

Returns
bool

Implemented in PPCustomFrame_Hash, PPTemplateFrame_Hash, PPFrame_Hash, PPCustomFrame_DOM, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ isTemplate()

PPFrame::isTemplate ( )

Return true if the frame is a template frame.

Returns
bool

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ isVolatile()

PPFrame::isVolatile ( )

Get the "volatile" flag.

Callers should avoid caching the result of an expansion if it has the volatile flag set.

See also
self::setVolatile()
Returns
bool

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ loopCheck()

PPFrame::loopCheck (   $title)

Returns true if the infinite loop check is OK, false if a loop is detected.

Parameters
Title$title
Returns
bool

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ newChild()

PPFrame::newChild (   $args = false,
  $title = false,
  $indexOffset = 0 
)

Create a child frame.

Parameters
array | bool$args
bool | Title$title
int$indexOffsetA number subtracted from the index attributes of the arguments
Returns
PPFrame

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ setTTL()

PPFrame::setTTL (   $ttl)

Set the TTL of the output of this frame and all of its ancestors.

Has no effect if the new TTL is greater than the one already set. Note that it is the caller's responsibility to change the cache expiry of the page as a whole, if such behavior is desired.

See also
self::getTTL()
Parameters
int$ttl

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ setVolatile()

PPFrame::setVolatile (   $flag = true)

Set the "volatile" flag.

Note that this is somewhat of a "hack" in order to make extensions with side effects (such as Cite) work with the PHP parser. New extensions should be written in a way that they do not need this function, because other parsers (such as Parsoid) are not guaranteed to respect it, and it may be removed in the future.

Parameters
bool$flag

Implemented in PPTemplateFrame_Hash, PPFrame_Hash, PPTemplateFrame_DOM, and PPFrame_DOM.

◆ virtualBracketedImplode()

PPFrame::virtualBracketedImplode (   $start,
  $sep,
  $end 
)

Virtual implode with brackets.

Parameters
string$start
string$sep
string$end
string | PPNode$args,...
Returns
PPNode

Implemented in PPFrame_Hash, and PPFrame_DOM.

◆ virtualImplode()

PPFrame::virtualImplode (   $sep)

Makes an object that, when expand()ed, will be the same as one obtained with implode()

Parameters
string$sep
string | PPNode$args,...
Returns
PPNode

Implemented in PPFrame_Hash, and PPFrame_DOM.

Member Data Documentation

◆ NO_ARGS

const PPFrame::NO_ARGS = 1

Definition at line 167 of file Preprocessor.php.

Referenced by Parser\getPreloadText().

◆ NO_IGNORE

const PPFrame::NO_IGNORE = 8

Definition at line 170 of file Preprocessor.php.

◆ NO_TAGS

const PPFrame::NO_TAGS = 32

Definition at line 172 of file Preprocessor.php.

◆ NO_TEMPLATES

const PPFrame::NO_TEMPLATES = 2

Definition at line 168 of file Preprocessor.php.

Referenced by Parser\getPreloadText(), and Parser\replaceVariables().

◆ RECOVER_COMMENTS

const PPFrame::RECOVER_COMMENTS = 16

Definition at line 171 of file Preprocessor.php.

◆ RECOVER_ORIG

const PPFrame::RECOVER_ORIG = 59

◆ STRIP_COMMENTS

const PPFrame::STRIP_COMMENTS = 4

Definition at line 169 of file Preprocessor.php.

Referenced by Parser\braceSubstitution(), and CoreParserFunctions\tagObj().

◆ SUPPORTS_INDEX_OFFSET

const PPFrame::SUPPORTS_INDEX_OFFSET = 1

This constant exists when $indexOffset is supported in newChild()

Definition at line 177 of file Preprocessor.php.


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