MediaWiki  1.29.1
Preprocessor Class Reference
Inheritance diagram for Preprocessor:

Public Member Functions

 newCustomFrame ( $args)
 Create a new custom frame for programmatic use of parameter replacement as used in some extensions. More...
 
 newFrame ()
 Create a new top-level frame for expansion of a page. More...
 
 newPartNodeArray ( $values)
 Create a new custom node for programmatic use of parameter replacement as used in some extensions. More...
 
 preprocessToObj ( $text, $flags=0)
 Preprocess text to a PPNode. More...
 

Public Attributes

const CACHE_VERSION = 1
 

Protected Member Functions

 cacheGetTree ( $text, $flags)
 Attempt to load a precomputed document tree for some given wikitext from the cache. More...
 
 cacheSetTree ( $text, $flags, $tree)
 Store a document tree in the cache. More...
 

Protected Attributes

array $rules
 Brace matching rules. More...
 

Detailed Description

Definition at line 29 of file Preprocessor.php.

Member Function Documentation

◆ cacheGetTree()

Preprocessor::cacheGetTree (   $text,
  $flags 
)
protected

Attempt to load a precomputed document tree for some given wikitext from the cache.

Parameters
string$text
int$flags
Returns
PPNode_Hash_Tree|bool

Definition at line 95 of file Preprocessor.php.

References $cache, $flags, $value, class, ObjectCache\getInstance(), RequestContext\getMain(), and wfMemcKey().

Referenced by Preprocessor_Hash\preprocessToObj(), and Preprocessor_DOM\preprocessToObj().

◆ cacheSetTree()

Preprocessor::cacheSetTree (   $text,
  $flags,
  $tree 
)
protected

Store a document tree in the cache.

Parameters
string$text
int$flags

Definition at line 66 of file Preprocessor.php.

References $cache, $flags, $value, class, ObjectCache\getInstance(), RequestContext\getMain(), and wfMemcKey().

Referenced by Preprocessor_Hash\preprocessToObj(), and Preprocessor_DOM\preprocessToObj().

◆ newCustomFrame()

Preprocessor::newCustomFrame (   $args)
abstract

Create a new custom frame for programmatic use of parameter replacement as used in some extensions.

Parameters
array$args
Returns
PPFrame

Reimplemented in Preprocessor_Hash, and Preprocessor_DOM.

◆ newFrame()

Preprocessor::newFrame ( )
abstract

Create a new top-level frame for expansion of a page.

Returns
PPFrame

Reimplemented in Preprocessor_Hash, and Preprocessor_DOM.

◆ newPartNodeArray()

Preprocessor::newPartNodeArray (   $values)
abstract

Create a new custom node for programmatic use of parameter replacement as used in some extensions.

Parameters
array$values

Reimplemented in Preprocessor_Hash, and Preprocessor_DOM.

◆ preprocessToObj()

Preprocessor::preprocessToObj (   $text,
  $flags = 0 
)
abstract

Preprocess text to a PPNode.

Parameters
string$text
int$flags
Returns
PPNode

Reimplemented in Preprocessor_DOM, and Preprocessor_Hash.

Member Data Documentation

◆ $rules

array Preprocessor::$rules
protected
Initial value:
= [
'{' => [
'end' => '}',
'names' => [
2 => 'template',
3 => 'tplarg',
],
'min' => 2,
'max' => 3,
],
'[' => [
'end' => ']',
'names' => [ 2 => null ],
'min' => 2,
'max' => 2,
],
'-{' => [
'end' => '}-',
'names' => [ 1 => null ],
'min' => 1,
'max' => 1,
],
]

Brace matching rules.

Definition at line 36 of file Preprocessor.php.

◆ CACHE_VERSION

const Preprocessor::CACHE_VERSION = 1

Definition at line 31 of file Preprocessor.php.


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