MediaWiki  master
StripState Class Reference

Public Member Functions

 __construct (Parser $parser=null, $options=[])
 
 addGeneral ($marker, $value)
 
 addNoWiki ($marker, $value)
 Add a nowiki strip item. More...
 
 getLimitReport ()
 Get an array of parameters to pass to ParserOutput::setLimitReportData() More...
 
 getSubState ($text)
 Get a StripState object which is sufficient to unstrip the given text. More...
 
 killMarkers ($text)
 Remove any strip markers found in the given text. More...
 
 merge ($otherState, $texts)
 Merge another StripState object into this one. More...
 
 unstripBoth ($text)
 
 unstripGeneral ($text)
 
 unstripNoWiki ($text)
 

Protected Member Functions

 addItem ($type, $marker, $value)
 
 unstripType ($type, $text)
 

Protected Attributes

 $circularRefGuard
 
 $data
 
 $depth = 0
 
 $depthLimit = 20
 
 $expandSize = 0
 
 $highestDepth = 0
 
 $parser
 
 $regex
 
 $sizeLimit = 5000000
 

Private Member Functions

 getLimitationWarning ($type, $max= '')
 Get warning HTML and register a limitation warning with the parser. More...
 
 getWarning ($message, $max= '')
 Get warning HTML. More...
 

Detailed Description

Todo:
document, briefly.

Definition at line 28 of file StripState.php.

Constructor & Destructor Documentation

StripState::__construct ( Parser  $parser = null,
  $options = [] 
)
Parameters
Parser | null$parser
array$options

Definition at line 46 of file StripState.php.

References $options, $parser, data, and Parser\MARKER_PREFIX.

Member Function Documentation

StripState::addGeneral (   $marker,
  $value 
)
Parameters
string$marker
string$value

Definition at line 76 of file StripState.php.

References $value, and addItem().

StripState::addItem (   $type,
  $marker,
  $value 
)
protected
Exceptions
MWException
Parameters
string$type
string$marker
string$value

Definition at line 86 of file StripState.php.

References $type, $value, and data.

Referenced by addGeneral(), and addNoWiki().

StripState::addNoWiki (   $marker,
  $value 
)

Add a nowiki strip item.

Parameters
string$marker
string$value

Definition at line 68 of file StripState.php.

References $value, and addItem().

StripState::getLimitationWarning (   $type,
  $max = '' 
)
private

Get warning HTML and register a limitation warning with the parser.

Parameters
string$type
int$max
Returns
string

Definition at line 178 of file StripState.php.

References $type, and getWarning().

Referenced by unstripType().

StripState::getLimitReport ( )

Get an array of parameters to pass to ParserOutput::setLimitReportData()

Definition at line 205 of file StripState.php.

References $depthLimit, $expandSize, $highestDepth, and $sizeLimit.

StripState::getSubState (   $text)

Get a StripState object which is sufficient to unstrip the given text.

It will contain the minimum subset of strip items necessary.

Deprecated:
since 1.31
Parameters
string$text
Returns
StripState

Definition at line 230 of file StripState.php.

References $key, data, Parser\MARKER_PREFIX, and wfDeprecated().

StripState::getWarning (   $message,
  $max = '' 
)
private

Get warning HTML.

Parameters
string$message
int$max
Returns
string

Definition at line 192 of file StripState.php.

References wfMessage().

Referenced by getLimitationWarning(), and unstripType().

StripState::killMarkers (   $text)

Remove any strip markers found in the given text.

Parameters
string$text
Returns
string

Definition at line 294 of file StripState.php.

StripState::merge (   $otherState,
  $texts 
)

Merge another StripState object into this one.

The strip marker keys will not be preserved. The strings in the $texts array will have their strip markers rewritten, the resulting array of strings will be returned.

Deprecated:
since 1.31
Parameters
StripState$otherState
array$texts
Returns
array

Definition at line 269 of file StripState.php.

References $key, $type, $value, as, data, Parser\MARKER_PREFIX, use, wfDeprecated(), and wfRandomString().

StripState::unstripBoth (   $text)
Parameters
string$text
Returns
mixed

Definition at line 114 of file StripState.php.

References unstripType().

StripState::unstripGeneral (   $text)
Parameters
string$text
Returns
mixed

Definition at line 98 of file StripState.php.

References unstripType().

StripState::unstripNoWiki (   $text)
Parameters
string$text
Returns
mixed

Definition at line 106 of file StripState.php.

References unstripType().

StripState::unstripType (   $type,
  $text 
)
protected
Parameters
string$type
string$text
Returns
mixed

Definition at line 125 of file StripState.php.

References $depth, $ret, $type, $value, data, getLimitationWarning(), getWarning(), and use.

Referenced by unstripBoth(), unstripGeneral(), and unstripNoWiki().

Member Data Documentation

StripState::$circularRefGuard
protected

Definition at line 34 of file StripState.php.

StripState::$data
protected

Definition at line 29 of file StripState.php.

StripState::$depth = 0
protected

Definition at line 35 of file StripState.php.

Referenced by unstripType().

StripState::$depthLimit = 20
protected

Definition at line 39 of file StripState.php.

Referenced by getLimitReport().

StripState::$expandSize = 0
protected

Definition at line 37 of file StripState.php.

Referenced by getLimitReport().

StripState::$highestDepth = 0
protected

Definition at line 36 of file StripState.php.

Referenced by getLimitReport().

StripState::$parser
protected

Definition at line 32 of file StripState.php.

Referenced by __construct().

StripState::$regex
protected

Definition at line 30 of file StripState.php.

StripState::$sizeLimit = 5000000
protected

Definition at line 40 of file StripState.php.

Referenced by getLimitReport().


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