MediaWiki  1.23.14
StripState Class Reference

Public Member Functions

 __construct ( $prefix)
 
 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

◆ __construct()

StripState::__construct (   $prefix)
Parameters
$prefixstring

Definition at line 42 of file StripState.php.

References $prefix, array(), and data.

Member Function Documentation

◆ addGeneral()

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

Definition at line 65 of file StripState.php.

References $value, and addItem().

◆ addItem()

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

Definition at line 75 of file StripState.php.

References $type, $value, and data.

Referenced by addGeneral(), and addNoWiki().

◆ addNoWiki()

StripState::addNoWiki (   $marker,
  $value 
)

Add a nowiki strip item.

Parameters
$marker
$value

Definition at line 57 of file StripState.php.

References $value, and addItem().

◆ getSubState()

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
$textstring
Returns
StripState

Definition at line 166 of file StripState.php.

References data.

◆ killMarkers()

StripState::killMarkers (   $text)

Remove any strip markers found in the given text.

Parameters
$textInput string
Returns
string

Definition at line 232 of file StripState.php.

◆ merge()

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
$otherStateStripState
$textsArray
Returns
Array

Definition at line 202 of file StripState.php.

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

◆ mergeCallback()

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

Definition at line 221 of file StripState.php.

◆ unstripBoth()

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

Definition at line 103 of file StripState.php.

References unstripType().

◆ unstripCallback()

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

Definition at line 133 of file StripState.php.

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

◆ unstripGeneral()

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

Definition at line 87 of file StripState.php.

References unstripType().

◆ unstripNoWiki()

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

Definition at line 95 of file StripState.php.

References unstripType().

◆ unstripType()

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

Definition at line 114 of file StripState.php.

References $tempType, $type, array(), data, wfProfileIn(), and wfProfileOut().

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

Member Data Documentation

◆ $circularRefGuard

StripState::$circularRefGuard
protected

Definition at line 34 of file StripState.php.

◆ $data

StripState::$data
protected

Definition at line 30 of file StripState.php.

◆ $prefix

StripState::$prefix
protected

Definition at line 29 of file StripState.php.

Referenced by __construct().

◆ $recursionLevel

StripState::$recursionLevel = 0
protected

Definition at line 35 of file StripState.php.

◆ $regex

StripState::$regex
protected

Definition at line 31 of file StripState.php.

◆ $tempMergePrefix

StripState::$tempMergePrefix

Definition at line 33 of file StripState.php.

◆ $tempType

StripState::$tempType
protected

Definition at line 33 of file StripState.php.

Referenced by unstripType().

◆ UNSTRIP_RECURSION_LIMIT

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: