MediaWiki  master
PPFrame_DOM Class Reference

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

Inheritance diagram for PPFrame_DOM:
Collaboration diagram for PPFrame_DOM:

Public Member Functions

 __construct ( $preprocessor)
 Construct a new preprocessor frame. More...
 
 __toString ()
 
 cachedExpand ( $key, $root, $flags=0)
 
 expand ( $root, $flags=0)
 
 getArgument ( $name)
 
 getArguments ()
 
 getNamedArguments ()
 
 getNumberedArguments ()
 
 getPDBK ( $level=false)
 
 getTitle ()
 Get a title of frame. More...
 
 getTTL ()
 Get the TTL. More...
 
 implode ( $sep,... $args)
 Implode with no flags specified This previously called implodeWithFlags but has now been inlined to reduce stack depth. More...
 
 implodeWithFlags ( $sep, $flags,... $args)
 
 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 new child frame $args is optionally a multi-root PPNode or array containing the template arguments. More...
 
 setTTL ( $ttl)
 Set the TTL. More...
 
 setVolatile ( $flag=true)
 Set the volatile flag. More...
 
 virtualBracketedImplode ( $start, $sep, $end,... $args)
 Virtual implode with brackets. More...
 
 virtualImplode ( $sep,... $args)
 Makes an object that, when expand()ed, will be the same as one obtained with implode() More...
 
- Public Member Functions inherited from PPFrame
 implode ( $sep)
 Implode with no flags specified. More...
 
 implodeWithFlags ( $sep, $flags)
 Implode with flags for expand() 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

 $depth
 Recursion depth of this frame, top = 0 Note that this is NOT the same as expansion depth in expand() More...
 
 $loopCheckHash
 Hashtable listing templates which are disallowed for expansion in this frame, having been encountered previously in parent frames. More...
 
Parser $parser
 
Preprocessor $preprocessor
 
Title $title
 
 $titleCache
 
- Public Attributes inherited from 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
 
const SUPPORTS_INDEX_OFFSET = 1
 This constant exists when $indexOffset is supported in newChild() More...
 

Protected Attributes

array $childExpansionCache
 

Private Attributes

 $ttl = null
 
 $volatile = false
 

Detailed Description

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

Deprecated:
since 1.34, use PPFrame_Hash

Definition at line 28 of file PPFrame_DOM.php.

Constructor & Destructor Documentation

◆ __construct()

PPFrame_DOM::__construct (   $preprocessor)

Construct a new preprocessor frame.

Parameters
Preprocessor$preprocessorThe parent preprocessor

Definition at line 70 of file PPFrame_DOM.php.

References $preprocessor, false, and title.

Member Function Documentation

◆ __toString()

PPFrame_DOM::__toString ( )

Definition at line 517 of file PPFrame_DOM.php.

◆ cachedExpand()

PPFrame_DOM::cachedExpand (   $key,
  $root,
  $flags = 0 
)
Exceptions
MWException
Parameters
string | int$key
string | PPNode_DOM | DOMNode | DOMNodeList$root
int$flags
Returns
string

Implements PPFrame.

Definition at line 148 of file PPFrame_DOM.php.

References expand().

◆ expand()

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

◆ getArgument()

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

Implements PPFrame.

Definition at line 563 of file PPFrame_DOM.php.

◆ getArguments()

PPFrame_DOM::getArguments ( )
Returns
array

Implements PPFrame.

Definition at line 532 of file PPFrame_DOM.php.

◆ getNamedArguments()

PPFrame_DOM::getNamedArguments ( )
Returns
array

Implements PPFrame.

Definition at line 546 of file PPFrame_DOM.php.

◆ getNumberedArguments()

PPFrame_DOM::getNumberedArguments ( )
Returns
array

Implements PPFrame.

Definition at line 539 of file PPFrame_DOM.php.

◆ getPDBK()

PPFrame_DOM::getPDBK (   $level = false)

Definition at line 521 of file PPFrame_DOM.php.

References title.

◆ getTitle()

PPFrame_DOM::getTitle ( )

Get a title of frame.

Returns
Title

Implements PPFrame.

Definition at line 591 of file PPFrame_DOM.php.

References $title.

◆ getTTL()

PPFrame_DOM::getTTL ( )

Get the TTL.

Returns
int|null

Implements PPFrame.

Definition at line 629 of file PPFrame_DOM.php.

References $ttl.

◆ implode()

PPFrame_DOM::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_DOM|DOMNode...$args
Returns
string

Definition at line 432 of file PPFrame_DOM.php.

References $args, $s, as, and expand().

◆ implodeWithFlags()

PPFrame_DOM::implodeWithFlags (   $sep,
  $flags,
  $args 
)
Parameters
string$sep
int$flags
string|PPNode_DOM|DOMNode...$args
Returns
string

Definition at line 402 of file PPFrame_DOM.php.

References $args, $s, as, and expand().

◆ isEmpty()

PPFrame_DOM::isEmpty ( )

Returns true if there are no arguments in this frame.

Returns
bool

Implements PPFrame.

Definition at line 555 of file PPFrame_DOM.php.

◆ isTemplate()

PPFrame_DOM::isTemplate ( )

Return true if the frame is a template frame.

Returns
bool

Implements PPFrame.

Definition at line 582 of file PPFrame_DOM.php.

◆ isVolatile()

PPFrame_DOM::isVolatile ( )

Get the volatile flag.

Returns
bool

Implements PPFrame.

Definition at line 609 of file PPFrame_DOM.php.

References $volatile.

Referenced by PPTemplateFrame_DOM\cachedExpand().

◆ loopCheck()

PPFrame_DOM::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 573 of file PPFrame_DOM.php.

References Title\getPrefixedDBkey().

◆ newChild()

PPFrame_DOM::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
bool | array$args
Title | bool$title
int$indexOffset
Returns
PPTemplateFrame_DOM

Implements PPFrame.

Definition at line 89 of file PPFrame_DOM.php.

References $args, $name, $title, $value, as, expand(), PPFrame\STRIP_COMMENTS, text, title, wfEscapeWikiText(), and wfMessage().

◆ setTTL()

PPFrame_DOM::setTTL (   $ttl)

Set the TTL.

Parameters
int$ttl

Implements PPFrame.

Definition at line 618 of file PPFrame_DOM.php.

References $ttl, and null.

◆ setVolatile()

PPFrame_DOM::setVolatile (   $flag = true)

Set the volatile flag.

Parameters
bool$flag

Implements PPFrame.

Definition at line 600 of file PPFrame_DOM.php.

◆ virtualBracketedImplode()

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

Virtual implode with brackets.

Parameters
string$start
string$sep
string$end
string|PPNode_DOM|DOMNode...$args
Returns
array

Definition at line 493 of file PPFrame_DOM.php.

References $args, $out, and as.

Referenced by expand().

◆ virtualImplode()

PPFrame_DOM::virtualImplode (   $sep,
  $args 
)

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

Parameters
string$sep
string|PPNode_DOM|DOMNode...$args
Returns
array

Definition at line 462 of file PPFrame_DOM.php.

References $args, $out, and as.

Member Data Documentation

◆ $childExpansionCache

array PPFrame_DOM::$childExpansionCache
protected

Definition at line 64 of file PPFrame_DOM.php.

◆ $depth

PPFrame_DOM::$depth

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

Definition at line 56 of file PPFrame_DOM.php.

◆ $loopCheckHash

PPFrame_DOM::$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_DOM.php.

◆ $parser

Parser PPFrame_DOM::$parser

Definition at line 38 of file PPFrame_DOM.php.

◆ $preprocessor

Preprocessor PPFrame_DOM::$preprocessor

◆ $title

Title PPFrame_DOM::$title

Definition at line 43 of file PPFrame_DOM.php.

Referenced by PPTemplateFrame_DOM\__construct(), getTitle(), and newChild().

◆ $titleCache

PPFrame_DOM::$titleCache

Definition at line 44 of file PPFrame_DOM.php.

◆ $ttl

PPFrame_DOM::$ttl = null
private

Definition at line 59 of file PPFrame_DOM.php.

Referenced by getTTL(), PPTemplateFrame_DOM\setTTL(), and setTTL().

◆ $volatile

PPFrame_DOM::$volatile = false
private

Definition at line 58 of file PPFrame_DOM.php.

Referenced by isVolatile().


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