MediaWiki  REL1_31
Preprocessor_Hash Class Reference

Differences from DOM schema: More...

Inheritance diagram for Preprocessor_Hash:
Collaboration diagram for Preprocessor_Hash:

Public Member Functions

 __construct ( $parser)
 newCustomFrame ( $args)
 newFrame ()
 newPartNodeArray ( $values)
 preprocessToObj ( $text, $flags=0)
 Preprocess some wikitext and return the document tree. More...

Public Attributes

Parser $parser
const CACHE_PREFIX = 'preprocess-hash'
- Public Attributes inherited from Preprocessor

Static Private Member Functions

static addLiteral (array &$accum, $text)

Additional Inherited Members

- Protected Member Functions inherited from Preprocessor
 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 inherited from Preprocessor
array $rules
 Brace matching rules. More...

Detailed Description

Differences from DOM schema:

  • attribute nodes are children
  • "<h>" nodes that aren't at the top are replaced with <possible-h>

Nodes are stored in a recursive array data structure. A node store is an array where each element may be either a scalar (representing a text node) or a "descriptor", which is a two-element array where the first element is the node name and the second element is the node store for the children.

Attributes are represented as children that have a node name starting with "@", and a single text node child.

: Consider replacing descriptor arrays with objects of a new class. Benchmark and measure resulting memory impact.

Definition at line 43 of file Preprocessor_Hash.php.

Constructor & Destructor Documentation

◆ __construct()

Preprocessor_Hash::__construct (   $parser)

Definition at line 53 of file Preprocessor_Hash.php.

References $parser.

Member Function Documentation

◆ addLiteral()

static Preprocessor_Hash::addLiteral ( array $accum,

Definition at line 787 of file Preprocessor_Hash.php.

Referenced by preprocessToObj().

◆ newCustomFrame()

Preprocessor_Hash::newCustomFrame (   $args)

Reimplemented from Preprocessor.

Definition at line 68 of file Preprocessor_Hash.php.

References $args.

◆ newFrame()

Preprocessor_Hash::newFrame ( )

Reimplemented from Preprocessor.

Definition at line 60 of file Preprocessor_Hash.php.

◆ newPartNodeArray()

Preprocessor_Hash::newPartNodeArray (   $values)

Reimplemented from Preprocessor.

Definition at line 76 of file Preprocessor_Hash.php.

References as.

◆ preprocessToObj()

Preprocessor_Hash::preprocessToObj (   $text,
  $flags = 0 

Preprocess some wikitext and return the document tree.

string$textThe text to parse
int$flagsBitwise combination of: Parser::PTD_FOR_INCLUSION Handle "<noinclude>" and "<includeonly>" as if the text is being included. Default is to assume a direct page view.

The generated DOM tree must depend only on the input text and the flags. The DOM tree must be the same in OT_HTML and OT_WIKI mode, to avoid a regression of T6899.

Any flag added to the $flags parameter here, or any other parameter liable to cause a change in the DOM tree for a given text, must be passed through the section identifier in the section edit link and thus back to extractSections().


Reimplemented from Preprocessor.

Definition at line 118 of file Preprocessor_Hash.php.

References $matches, $name, $wgDisableLangConversion, addLiteral(), as, Preprocessor\cacheGetTree(), false, global, name, names, part, Parser\PTD_FOR_INCLUSION, root, and title.

Member Data Documentation

◆ $parser

Parser Preprocessor_Hash::$parser

Definition at line 48 of file Preprocessor_Hash.php.

Referenced by __construct().


const Preprocessor_Hash::CACHE_PREFIX = 'preprocess-hash'

Definition at line 50 of file Preprocessor_Hash.php.


const Preprocessor_Hash::CACHE_VERSION = 2

Definition at line 51 of file Preprocessor_Hash.php.

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