MediaWiki master
PPFrame_Hash Class Reference

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

Inherits PPFrame.

Inherited by PPCustomFrame_Hash, and PPTemplateFrame_Hash.

Collaboration diagram for 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 PPFrame
const NO_ARGS = 1
 
const NO_IGNORE = 8
 
const NO_TAGS = 32
 
const NO_TEMPLATES = 2
 
const PROCESS_NOWIKI = 64
 
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 30 of file PPFrame_Hash.php.

Constructor & Destructor Documentation

◆ __construct()

PPFrame_Hash::__construct ( $preprocessor)
Parameters
Preprocessor$preprocessorThe parent preprocessor

Definition at line 87 of file PPFrame_Hash.php.

References $preprocessor.

Member Function Documentation

◆ __toString()

PPFrame_Hash::__toString ( )

Reimplemented in PPCustomFrame_Hash, and PPTemplateFrame_Hash.

Definition at line 522 of file PPFrame_Hash.php.

◆ cachedExpand()

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

Implements PPFrame.

Reimplemented in PPTemplateFrame_Hash.

Definition at line 162 of file PPFrame_Hash.php.

References expand().

◆ expand()

◆ getArgument()

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

Implements PPFrame.

Reimplemented in PPCustomFrame_Hash, and PPTemplateFrame_Hash.

Definition at line 572 of file PPFrame_Hash.php.

◆ getArguments()

PPFrame_Hash::getArguments ( )
Returns
array

Implements PPFrame.

Reimplemented in PPCustomFrame_Hash, and PPTemplateFrame_Hash.

Definition at line 541 of file PPFrame_Hash.php.

◆ getNamedArguments()

PPFrame_Hash::getNamedArguments ( )
Returns
array

Implements PPFrame.

Reimplemented in PPTemplateFrame_Hash.

Definition at line 555 of file PPFrame_Hash.php.

◆ getNumberedArguments()

PPFrame_Hash::getNumberedArguments ( )
Returns
array

Implements PPFrame.

Reimplemented in PPTemplateFrame_Hash.

Definition at line 548 of file PPFrame_Hash.php.

◆ getPDBK()

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

Definition at line 530 of file PPFrame_Hash.php.

◆ getTitle()

PPFrame_Hash::getTitle ( )

Get a title of frame.

Returns
Title

Implements PPFrame.

Definition at line 601 of file PPFrame_Hash.php.

References $title.

◆ getTTL()

PPFrame_Hash::getTTL ( )
Returns
int|null

Implements PPFrame.

Definition at line 635 of file PPFrame_Hash.php.

◆ implode()

PPFrame_Hash::implode ( $sep,
$args )

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 PPFrame.

Definition at line 436 of file PPFrame_Hash.php.

References expand().

◆ implodeWithFlags()

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

Implements PPFrame.

Definition at line 407 of file PPFrame_Hash.php.

References expand().

◆ isEmpty()

PPFrame_Hash::isEmpty ( )

Returns true if there are no arguments in this frame.

Returns
bool

Implements PPFrame.

Reimplemented in PPCustomFrame_Hash, and PPTemplateFrame_Hash.

Definition at line 564 of file PPFrame_Hash.php.

◆ isTemplate()

PPFrame_Hash::isTemplate ( )

Return true if the frame is a template frame.

Returns
bool

Implements PPFrame.

Reimplemented in PPTemplateFrame_Hash.

Definition at line 592 of file PPFrame_Hash.php.

◆ isVolatile()

PPFrame_Hash::isVolatile ( )

Get the volatile flag.

Returns
bool

Implements PPFrame.

Definition at line 619 of file PPFrame_Hash.php.

Referenced by PPTemplateFrame_Hash\cachedExpand().

◆ loopCheck()

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 PPFrame.

Definition at line 583 of file PPFrame_Hash.php.

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

◆ newChild()

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 PPFrame.

Definition at line 108 of file PPFrame_Hash.php.

References $title, expand(), and PPFrame\STRIP_COMMENTS.

◆ setTTL()

PPFrame_Hash::setTTL ( $ttl)
Parameters
int$ttl

Implements PPFrame.

Reimplemented in PPTemplateFrame_Hash.

Definition at line 626 of file PPFrame_Hash.php.

◆ setVolatile()

PPFrame_Hash::setVolatile ( $flag = true)

Set the volatile flag.

Parameters
bool$flag

Implements PPFrame.

Reimplemented in PPTemplateFrame_Hash.

Definition at line 610 of file PPFrame_Hash.php.

◆ virtualBracketedImplode()

PPFrame_Hash::virtualBracketedImplode ( $start,
$sep,
$end,
$args )

Virtual implode with brackets.

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

Implements PPFrame.

Definition at line 498 of file PPFrame_Hash.php.

Referenced by expand().

◆ virtualImplode()

PPFrame_Hash::virtualImplode ( $sep,
$args )

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 PPFrame.

Definition at line 466 of file PPFrame_Hash.php.

Member Data Documentation

◆ $childExpansionCache

array PPFrame_Hash::$childExpansionCache
protected

Definition at line 74 of file PPFrame_Hash.php.

◆ $depth

int 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 64 of file PPFrame_Hash.php.

◆ $loopCheckHash

true [] PPFrame_Hash::$loopCheckHash

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

Definition at line 57 of file PPFrame_Hash.php.

◆ $parser

Parser PPFrame_Hash::$parser

Definition at line 35 of file PPFrame_Hash.php.

◆ $preprocessor

Preprocessor PPFrame_Hash::$preprocessor

◆ $title

Title PPFrame_Hash::$title

Definition at line 45 of file PPFrame_Hash.php.

Referenced by PPTemplateFrame_Hash\__construct(), getTitle(), loopCheck(), and newChild().

◆ $titleCache

string false [] PPFrame_Hash::$titleCache

Definition at line 50 of file PPFrame_Hash.php.


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