MediaWiki  1.28.0
StripState Class Reference

Public Member Functions

 __construct ($prefix=null)
 
 addGeneral ($marker, $value)
 
 addNoWiki ($marker, $value)
 Add a nowiki strip item. 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)
 

Public Attributes

 $tempMergePrefix
 
const UNSTRIP_RECURSION_LIMIT = 20
 

Protected Member Functions

 addItem ($type, $marker, $value)
 
 mergeCallback ($m)
 
 unstripCallback ($m)
 
 unstripType ($type, $text)
 

Protected Attributes

 $circularRefGuard
 
 $data
 
 $prefix
 
 $recursionLevel = 0
 
 $regex
 
 $tempType
 

Detailed Description

Todo:
document, briefly.

Definition at line 28 of file StripState.php.

Constructor & Destructor Documentation

StripState::__construct (   $prefix = null)
Parameters
string | null$prefix
Since
1.26 The prefix argument should be omitted, as the strip marker prefix string is now a constant.

Definition at line 44 of file StripState.php.

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

Member Function Documentation

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

Definition at line 70 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 80 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 62 of file StripState.php.

References $value, and addItem().

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.

Parameters
string$text
Returns
StripState

Definition at line 173 of file StripState.php.

References data, and Parser\MARKER_PREFIX.

StripState::killMarkers (   $text)

Remove any strip markers found in the given text.

Parameters
string$textInput string
Returns
string

Definition at line 239 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.

Parameters
StripState$otherState
array$texts
Returns
array

Definition at line 209 of file StripState.php.

References $type, $value, as, data, and wfRandomString().

StripState::mergeCallback (   $m)
protected
Parameters
array$m
Returns
string

Definition at line 228 of file StripState.php.

References Parser\MARKER_PREFIX.

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

Definition at line 108 of file StripState.php.

References unstripType().

StripState::unstripCallback (   $m)
protected
Parameters
array$m
Returns
array

Definition at line 136 of file StripState.php.

References $ret, $tempType, $value, data, unstripType(), and wfMessage().

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

Definition at line 92 of file StripState.php.

References unstripType().

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

Definition at line 100 of file StripState.php.

References unstripType().

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

Definition at line 119 of file StripState.php.

References $tempType, $type, and data.

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

Member Data Documentation

StripState::$circularRefGuard
protected

Definition at line 34 of file StripState.php.

StripState::$data
protected

Definition at line 30 of file StripState.php.

StripState::$prefix
protected

Definition at line 29 of file StripState.php.

Referenced by __construct().

StripState::$recursionLevel = 0
protected

Definition at line 35 of file StripState.php.

StripState::$regex
protected

Definition at line 31 of file StripState.php.

StripState::$tempMergePrefix

Definition at line 33 of file StripState.php.

StripState::$tempType
protected

Definition at line 33 of file StripState.php.

Referenced by unstripCallback(), and unstripType().

const StripState::UNSTRIP_RECURSION_LIMIT = 20

Definition at line 37 of file StripState.php.


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