MediaWiki master
MediaWiki\Parser\PPFrame_Hash Class Reference

An expansion frame, used as a context to expand the result of preprocessToObj(). More...

Inherits Stringable, and MediaWiki\Parser\PPFrame.

Inherited by MediaWiki\Parser\PPCustomFrame_Hash, and MediaWiki\Parser\PPTemplateFrame_Hash.

Collaboration diagram for MediaWiki\Parser\PPFrame_Hash:

Public Member Functions

 __construct ( $preprocessor)
 __toString ()
 cachedExpand ( $key, $root, $flags=0)
 expand ( $root, $flags=0)
 getArgument ( $name)
 getArguments ()
 getNamedArguments ()
 getNumberedArguments ()
 getPDBK ( $level=false)
 getTitle ()
 Get a title of frame.
 getTTL ()
 implode ( $sep,... $args)
 Implode with no flags specified This previously called implodeWithFlags but has now been inlined to reduce stack depth.
 implodeWithFlags ( $sep, $flags,... $args)
 isEmpty ()
 Returns true if there are no arguments in this frame.
 isTemplate ()
 Return true if the frame is a template frame.
 isVolatile ()
 Get the volatile flag.
 loopCheck ( $title)
 Returns true if the infinite loop check is OK, false if a loop is detected.
 newChild ( $args=false, $title=false, $indexOffset=0)
 Create a new child frame $args is optionally a multi-root PPNode or array containing the template arguments.
 setTTL ( $ttl)
 setVolatile ( $flag=true)
 Set the volatile flag.
 virtualBracketedImplode ( $start, $sep, $end,... $args)
 Virtual implode with brackets.
 virtualImplode ( $sep,... $args)
 Makes an object that, when expand()ed, will be the same as one obtained with implode().

Public Attributes

int $depth
 Recursion depth of this frame, top = 0 Note that this is NOT the same as expansion depth in expand().
true[] $loopCheckHash
 Hashtable listing templates which are disallowed for expansion in this frame, having been encountered previously in parent frames.
Parser $parser
Preprocessor $preprocessor
Title $title
string false[] $titleCache
Public Attributes inherited from MediaWiki\Parser\PPFrame
const NO_ARGS = 1
const NO_IGNORE = 8
const NO_TAGS = 32
const NO_TEMPLATES = 2
const RECOVER_COMMENTS = 16
const RECOVER_ORIG
const STRIP_COMMENTS = 4

Protected Attributes

array $childExpansionCache

Detailed Description

An expansion frame, used as a context to expand the result of preprocessToObj().

Definition at line 23 of file PPFrame_Hash.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\PPFrame_Hash::__construct ( $preprocessor)
Parameters
Preprocessor$preprocessorThe parent preprocessor

Definition at line 80 of file PPFrame_Hash.php.

References $preprocessor.

Member Function Documentation

◆ __toString()

MediaWiki\Parser\PPFrame_Hash::__toString ( )

◆ cachedExpand()

MediaWiki\Parser\PPFrame_Hash::cachedExpand ( $key,
$root,
$flags = 0 )
Parameters
string | int$key
string | PPNode$root
int$flags
Returns
string

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 156 of file PPFrame_Hash.php.

References expand().

◆ expand()

◆ getArgument()

MediaWiki\Parser\PPFrame_Hash::getArgument ( $name)
Parameters
int | string$name
Returns
bool Always false in this implementation.

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPCustomFrame_Hash, and MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 578 of file PPFrame_Hash.php.

◆ getArguments()

MediaWiki\Parser\PPFrame_Hash::getArguments ( )
Returns
array

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPCustomFrame_Hash, and MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 547 of file PPFrame_Hash.php.

◆ getNamedArguments()

MediaWiki\Parser\PPFrame_Hash::getNamedArguments ( )
Returns
array

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 561 of file PPFrame_Hash.php.

◆ getNumberedArguments()

MediaWiki\Parser\PPFrame_Hash::getNumberedArguments ( )
Returns
array

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 554 of file PPFrame_Hash.php.

◆ getPDBK()

MediaWiki\Parser\PPFrame_Hash::getPDBK ( $level = false)
Parameters
string | false$level
Returns
false|string

Definition at line 536 of file PPFrame_Hash.php.

◆ getTitle()

MediaWiki\Parser\PPFrame_Hash::getTitle ( )

Get a title of frame.

Returns
Title

Implements MediaWiki\Parser\PPFrame.

Definition at line 607 of file PPFrame_Hash.php.

References $title.

◆ getTTL()

MediaWiki\Parser\PPFrame_Hash::getTTL ( )
Returns
int|null
Deprecated
since 1.46, use ParserOutput::getCacheExpiry()

Implements MediaWiki\Parser\PPFrame.

Definition at line 644 of file PPFrame_Hash.php.

References wfDeprecated().

◆ implode()

MediaWiki\Parser\PPFrame_Hash::implode ( $sep,
... )

Implode with no flags specified This previously called implodeWithFlags but has now been inlined to reduce stack depth.

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

Implements MediaWiki\Parser\PPFrame.

Definition at line 442 of file PPFrame_Hash.php.

References expand().

◆ implodeWithFlags()

MediaWiki\Parser\PPFrame_Hash::implodeWithFlags ( $sep,
$flags,
... )
Parameters
string$sep
int$flags
string|PPNode...$args
Returns
string

Implements MediaWiki\Parser\PPFrame.

Definition at line 413 of file PPFrame_Hash.php.

References expand().

◆ isEmpty()

MediaWiki\Parser\PPFrame_Hash::isEmpty ( )

Returns true if there are no arguments in this frame.

Returns
bool

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPCustomFrame_Hash, and MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 570 of file PPFrame_Hash.php.

◆ isTemplate()

MediaWiki\Parser\PPFrame_Hash::isTemplate ( )

Return true if the frame is a template frame.

Returns
bool

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 598 of file PPFrame_Hash.php.

◆ isVolatile()

MediaWiki\Parser\PPFrame_Hash::isVolatile ( )

Get the volatile flag.

Returns
bool

Implements MediaWiki\Parser\PPFrame.

Definition at line 625 of file PPFrame_Hash.php.

Referenced by MediaWiki\Parser\PPTemplateFrame_Hash\cachedExpand().

◆ loopCheck()

MediaWiki\Parser\PPFrame_Hash::loopCheck ( $title)

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

Parameters
Title$title
Returns
bool

Implements MediaWiki\Parser\PPFrame.

Definition at line 589 of file PPFrame_Hash.php.

References $title, and MediaWiki\Title\Title\getPrefixedDBkey().

◆ newChild()

MediaWiki\Parser\PPFrame_Hash::newChild ( $args = false,
$title = false,
$indexOffset = 0 )

Create a new child frame $args is optionally a multi-root PPNode or array containing the template arguments.

Parameters
PPNode[] | false | PPNode_Hash_Array$args
Title | false$title
int$indexOffset
Returns
PPTemplateFrame_Hash

Implements MediaWiki\Parser\PPFrame.

Definition at line 101 of file PPFrame_Hash.php.

References $title, expand(), MediaWiki\Message\Message\numParam(), MediaWiki\Parser\PPFrame\STRIP_COMMENTS, and wfEscapeWikiText().

◆ setTTL()

MediaWiki\Parser\PPFrame_Hash::setTTL ( $ttl)
Parameters
int$ttl
Deprecated
since 1.44, use ParserOutput::updateCacheExpiry()

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 633 of file PPFrame_Hash.php.

References wfDeprecated().

◆ setVolatile()

MediaWiki\Parser\PPFrame_Hash::setVolatile ( $flag = true)

Set the volatile flag.

Parameters
bool$flag

Implements MediaWiki\Parser\PPFrame.

Reimplemented in MediaWiki\Parser\PPTemplateFrame_Hash.

Definition at line 616 of file PPFrame_Hash.php.

◆ virtualBracketedImplode()

MediaWiki\Parser\PPFrame_Hash::virtualBracketedImplode ( $start,
$sep,
$end,
... )

Virtual implode with brackets.

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

Implements MediaWiki\Parser\PPFrame.

Definition at line 504 of file PPFrame_Hash.php.

Referenced by expand().

◆ virtualImplode()

MediaWiki\Parser\PPFrame_Hash::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_Hash_Array

Implements MediaWiki\Parser\PPFrame.

Definition at line 472 of file PPFrame_Hash.php.

Member Data Documentation

◆ $childExpansionCache

array MediaWiki\Parser\PPFrame_Hash::$childExpansionCache
protected

Definition at line 67 of file PPFrame_Hash.php.

◆ $depth

int MediaWiki\Parser\PPFrame_Hash::$depth

Recursion depth of this frame, top = 0 Note that this is NOT the same as expansion depth in expand().

Definition at line 57 of file PPFrame_Hash.php.

◆ $loopCheckHash

true [] MediaWiki\Parser\PPFrame_Hash::$loopCheckHash

Hashtable listing templates which are disallowed for expansion in this frame, having been encountered previously in parent frames.

Definition at line 50 of file PPFrame_Hash.php.

◆ $parser

Parser MediaWiki\Parser\PPFrame_Hash::$parser

Definition at line 28 of file PPFrame_Hash.php.

◆ $preprocessor

Preprocessor MediaWiki\Parser\PPFrame_Hash::$preprocessor

◆ $title

Title MediaWiki\Parser\PPFrame_Hash::$title

◆ $titleCache

string false [] MediaWiki\Parser\PPFrame_Hash::$titleCache

Definition at line 43 of file PPFrame_Hash.php.


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