MediaWiki  1.23.2
Preprocessor_Hash Class Reference

Differences from DOM schema: More...

Inheritance diagram for Preprocessor_Hash:
Collaboration diagram for Preprocessor_Hash:

Public Member Functions

 __construct ( $parser)
 Create a new preprocessor object based on an initialised Parser object. More...
 
 newCustomFrame ( $args)
 
 newFrame ()
 
 newPartNodeArray ( $values)
 
 preprocessToObj ( $text, $flags=0)
 Preprocess some wikitext and return the document tree. More...
 

Public Attributes

Parser $parser
 
const CACHE_VERSION = 1
 

Detailed Description

Differences from DOM schema:

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

Definition at line 30 of file Preprocessor_Hash.php.

Constructor & Destructor Documentation

◆ __construct()

Preprocessor_Hash::__construct (   $parser)

Create a new preprocessor object based on an initialised Parser object.

Parameters
$parserParser

Implements Preprocessor.

Definition at line 37 of file Preprocessor_Hash.php.

References $parser.

Member Function Documentation

◆ newCustomFrame()

Preprocessor_Hash::newCustomFrame (   $args)
Parameters
$argsarray
Returns
PPCustomFrame_Hash

Implements Preprocessor.

Definition at line 52 of file Preprocessor_Hash.php.

References $args.

◆ newFrame()

Preprocessor_Hash::newFrame ( )
Returns
PPFrame_Hash

Implements Preprocessor.

Definition at line 44 of file Preprocessor_Hash.php.

◆ newPartNodeArray()

Preprocessor_Hash::newPartNodeArray (   $values)
Parameters
$valuesarray
Returns
PPNode_Hash_Array

Implements Preprocessor.

Definition at line 60 of file Preprocessor_Hash.php.

References array(), and as.

◆ preprocessToObj()

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

Preprocess some wikitext and return the document tree.

This is the ghost of Parser::replace_variables().

Parameters
string$textthe text to parse
$flagsInteger: bitwise 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 bug 4899.

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

The output of this function is currently only cached in process memory, but a persistent cache may be implemented at a later date which takes further advantage of these strict dependency requirements.

Exceptions
MWException
Returns
PPNode_Hash_Tree

Implements Preprocessor.

Definition at line 110 of file Preprocessor_Hash.php.

References $count, $flags, $hash, $matches, $name, $version, $wgMemc, are, array(), as, character(), false, global, in, is(), line, PPNode_Hash_Tree\newWithText(), of, start, there, up, wfDebugLog(), wfMemcKey(), wfProfileIn(), and wfProfileOut().

Member Data Documentation

◆ $parser

Parser Preprocessor_Hash::$parser

Definition at line 33 of file Preprocessor_Hash.php.

Referenced by __construct().

◆ CACHE_VERSION

const Preprocessor_Hash::CACHE_VERSION = 1

Definition at line 35 of file Preprocessor_Hash.php.


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