46 wfDeprecated( __METHOD__ .
' with called with $prefix argument' .
47 ' (call with no arguments instead)',
'1.26' );
54 $this->circularRefGuard = [];
81 if ( !preg_match( $this->regex, $marker, $m ) ) {
126 $this->tempType =
$type;
127 $text = preg_replace_callback( $this->regex, [ $this,
'unstripCallback' ], $text );
128 $this->tempType = $oldType;
138 if ( isset( $this->
data[$this->tempType][$marker] ) ) {
139 if ( isset( $this->circularRefGuard[$marker] ) ) {
140 return '<span class="error">'
141 .
wfMessage(
'parser-unstrip-loop-warning' )->inContentLanguage()->text()
144 if ( $this->recursionLevel >= self::UNSTRIP_RECURSION_LIMIT ) {
145 return '<span class="error">' .
146 wfMessage(
'parser-unstrip-recursion-limit' )
147 ->numParams( self::UNSTRIP_RECURSION_LIMIT )->inContentLanguage()->text() .
150 $this->circularRefGuard[$marker] =
true;
151 $this->recursionLevel++;
153 if (
$value instanceof Closure ) {
157 $this->recursionLevel--;
158 unset( $this->circularRefGuard[$marker] );
178 $endPos = strpos( $text, Parser::MARKER_SUFFIX, $pos );
179 if ( $startPos ===
false || $endPos ===
false ) {
183 $endPos += strlen( Parser::MARKER_SUFFIX );
184 $marker = substr( $text, $startPos, $endPos - $startPos );
185 if ( !preg_match( $this->regex, $marker, $m ) ) {
190 if ( isset( $this->
data[
'nowiki'][$key] ) ) {
191 $subState->data[
'nowiki'][$key] = $this->
data[
'nowiki'][$key];
192 } elseif ( isset( $this->
data[
'general'][$key] ) ) {
193 $subState->data[
'general'][$key] = $this->
data[
'general'][$key];
209 public function merge( $otherState, $texts ) {
212 foreach ( $otherState->data
as $type => $items ) {
213 foreach ( $items
as $key =>
$value ) {
218 $this->tempMergePrefix = $mergePrefix;
219 $texts = preg_replace_callback( $otherState->regex, [ $this,
'mergeCallback' ], $texts );
220 $this->tempMergePrefix = null;
240 return preg_replace( $this->regex,
'', $text );
addNoWiki($marker, $value)
Add a nowiki strip item.
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
__construct($prefix=null)
addItem($type, $marker, $value)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
killMarkers($text)
Remove any strip markers found in the given text.
wfRandomString($length=32)
Get a random string containing a number of pseudo-random hex characters.
getSubState($text)
Get a StripState object which is sufficient to unstrip the given text.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock()-offset Set to overwrite offset parameter in $wgRequest set to ''to unsetoffset-wrap String Wrap the message in html(usually something like"<
const UNSTRIP_RECURSION_LIMIT
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
addGeneral($marker, $value)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
unstripType($type, $text)
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
merge($otherState, $texts)
Merge another StripState object into this one.