MediaWiki REL1_32
RegexlikeReplacer.php
Go to the documentation of this file.
1<?php
27 private $r;
28
32 public function __construct( $r ) {
33 wfDeprecated( __METHOD__, '1.32' );
34 $this->r = $r;
35 }
36
41 public function replace( array $matches ) {
42 $pairs = [];
43 foreach ( $matches as $i => $match ) {
44 $pairs["\$$i"] = $match;
45 }
46
47 return strtr( $this->r, $pairs );
48 }
49}
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Class to replace regex matches with a string similar to that used in preg_replace()
replace(array $matches)
Base class for "replacers", objects used in preg_replace_callback() and StringUtils::delimiterReplace...
Definition Replacer.php:27
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))