MediaWiki  1.28.0
Preprocessor_DOM Class Reference
Inheritance diagram for Preprocessor_DOM:
Collaboration diagram for Preprocessor_DOM:

Public Member Functions

 __construct ($parser)
 
 memCheck ()
 
 newCustomFrame ($args)
 
 newFrame ()
 
 newPartNodeArray ($values)
 
 preprocessToObj ($text, $flags=0)
 Preprocess some wikitext and return the document tree. More...
 
 preprocessToXml ($text, $flags=0)
 
- Public Member Functions inherited from Preprocessor
 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

 $memoryLimit
 
Parser $parser
 
const CACHE_PREFIX = 'preprocess-xml'
 
- Public Attributes inherited from Preprocessor
const CACHE_VERSION = 1
 

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...
 
array 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

Definition at line 28 of file Preprocessor_DOM.php.

Constructor & Destructor Documentation

Preprocessor_DOM::__construct (   $parser)

Definition at line 40 of file Preprocessor_DOM.php.

References $parser.

Member Function Documentation

Preprocessor_DOM::memCheck ( )
Exceptions
MWException
Returns
bool

Definition at line 114 of file Preprocessor_DOM.php.

References $limit.

Preprocessor_DOM::newCustomFrame (   $args)
Parameters
array$args
Returns
PPCustomFrame_DOM

Definition at line 64 of file Preprocessor_DOM.php.

References $args.

Preprocessor_DOM::newFrame ( )
Returns
PPFrame_DOM

Definition at line 56 of file Preprocessor_DOM.php.

Preprocessor_DOM::newPartNodeArray (   $values)
Parameters
array$values
Returns
PPNode_DOM
Exceptions
MWException

Definition at line 73 of file Preprocessor_DOM.php.

References as.

Preprocessor_DOM::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
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 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_DOM

Definition at line 150 of file Preprocessor_DOM.php.

References $flags, Preprocessor\cacheGetTree(), Preprocessor\cacheSetTree(), and preprocessToXml().

Preprocessor_DOM::preprocessToXml (   $text,
  $flags = 0 
)
Parameters
string$text
int$flags
Returns
string

Definition at line 195 of file Preprocessor_DOM.php.

References $flags, and Parser\PTD_FOR_INCLUSION.

Referenced by preprocessToObj().

Member Data Documentation

Preprocessor_DOM::$memoryLimit

Definition at line 36 of file Preprocessor_DOM.php.

Parser Preprocessor_DOM::$parser

Definition at line 34 of file Preprocessor_DOM.php.

Referenced by __construct().

const Preprocessor_DOM::CACHE_PREFIX = 'preprocess-xml'

Definition at line 38 of file Preprocessor_DOM.php.


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