BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
Preprocessor_Hash Class Reference
Inheritance diagram for Preprocessor_Hash:
Collaboration diagram for Preprocessor_Hash:

Public Member Functions

 __construct ($parser)
 
 newFrame ()
 
 newCustomFrame ($args)
 
 newPartNodeArray ($values)
 
 preprocessToObj ($text, $flags=0)
 
- Public Member Functions inherited from Preprocessor
 newFrame ()
 
 newCustomFrame ($args)
 
 newPartNodeArray ($values)
 
 preprocessToObj ($text, $flags=0)
 

Public Attributes

 $parser
 
const CACHE_PREFIX = 'preprocess-hash'
 
const CACHE_VERSION = 2
 
- Public Attributes inherited from Preprocessor
const CACHE_VERSION = 1
 

Additional Inherited Members

- Protected Member Functions inherited from Preprocessor
 cacheSetTree ($text, $flags, $tree)
 
 cacheGetTree ($text, $flags)
 
- Protected Attributes inherited from Preprocessor
 $rules
 

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.

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

Member Function Documentation

Preprocessor_Hash::newCustomFrame (   $args)
Parameters
array$args
Returns
PPCustomFrame_Hash
Preprocessor_Hash::newFrame ( )
Returns
PPFrame_Hash
Preprocessor_Hash::newPartNodeArray (   $values)
Parameters
array$values
Returns
PPNode_Hash_Array
Preprocessor_Hash::preprocessToObj (   $text,
  $flags = 0 
)

Preprocess some wikitext and return the document tree.

Parameters
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().

Exceptions
MWException
Returns
PPNode_Hash_Tree

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