MediaWiki fundraising/REL1_35
Message.php
Go to the documentation of this file.
1<?php
24
161class Message implements MessageSpecifier, Serializable {
163 public const FORMAT_PLAIN = 'plain';
165 public const FORMAT_BLOCK_PARSE = 'block-parse';
167 public const FORMAT_PARSE = 'parse';
169 public const FORMAT_TEXT = 'text';
171 public const FORMAT_ESCAPED = 'escaped';
172
177 protected static $listTypeMap = [
178 'comma' => 'commaList',
179 'semicolon' => 'semicolonList',
180 'pipe' => 'pipeList',
181 'text' => 'listToText',
182 ];
183
190 protected $interface = true;
191
197 protected $language = false;
198
203 protected $key;
204
208 protected $keysToTry;
209
213 protected $parameters = [];
214
219 protected $format = 'parse';
220
224 protected $useDatabase = true;
225
229 protected $title = null;
230
234 protected $content = null;
235
239 protected $message;
240
251 public function __construct( $key, $params = [], Language $language = null ) {
252 if ( $key instanceof MessageSpecifier ) {
253 if ( $params ) {
254 throw new InvalidArgumentException(
255 '$params must be empty if $key is a MessageSpecifier'
256 );
257 }
258 $params = $key->getParams();
259 $key = $key->getKey();
260 }
261
262 if ( !is_string( $key ) && !is_array( $key ) ) {
263 throw new InvalidArgumentException( '$key must be a string or an array' );
264 }
265
266 $this->keysToTry = (array)$key;
267
268 if ( empty( $this->keysToTry ) ) {
269 throw new InvalidArgumentException( '$key must not be an empty list' );
270 }
271
272 $this->key = reset( $this->keysToTry );
273
274 $this->parameters = array_values( $params );
275 // User language is only resolved in getLanguage(). This helps preserve the
276 // semantic intent of "user language" across serialize() and unserialize().
277 $this->language = $language ?: false;
278 }
279
285 public function serialize(): string {
286 return serialize( $this->__serialize() );
287 }
288
294 public function __serialize() {
295 return [
296 'interface' => $this->interface,
297 'language' => $this->language ? $this->language->getCode() : false,
298 'key' => $this->key,
299 'keysToTry' => $this->keysToTry,
300 'parameters' => $this->parameters,
301 'format' => $this->format,
302 'useDatabase' => $this->useDatabase,
303 // Optimisation: Avoid cost of TitleFormatter on serialize,
304 // and especially cost of TitleParser (via Title::newFromText)
305 // on retrieval.
306 'titlevalue' => ( $this->title
307 ? [ 0 => $this->title->getNamespace(), 1 => $this->title->getDBkey() ]
308 : null
309 ),
310 ];
311 }
312
318 public function unserialize( $serialized ): void {
320 }
321
327 public function __unserialize( $data ) {
328 if ( !is_array( $data ) ) {
329 throw new InvalidArgumentException( __METHOD__ . ': Invalid serialized data' );
330 }
331 $this->interface = $data['interface'];
332 $this->key = $data['key'];
333 $this->keysToTry = $data['keysToTry'];
334 $this->parameters = $data['parameters'];
335 $this->format = $data['format'];
336 $this->useDatabase = $data['useDatabase'];
337 $this->language = $data['language']
338 ? MediaWikiServices::getInstance()->getLanguageFactory()
339 ->getLanguage( $data['language'] )
340 : false;
341
342 // Since 1.35, the key 'titlevalue' is set, instead of 'titlestr'.
343 if ( isset( $data['titlevalue'] ) ) {
344 $this->title = Title::makeTitle( $data['titlevalue'][0], $data['titlevalue'][1] );
345 } elseif ( isset( $data['titlestr'] ) ) {
346 $this->title = Title::newFromText( $data['titlestr'] );
347 } else {
348 $this->title = null; // Explicit for sanity
349 }
350 }
351
358 public function isMultiKey() {
359 return count( $this->keysToTry ) > 1;
360 }
361
368 public function getKeysToTry() {
369 return $this->keysToTry;
370 }
371
383 public function getKey() {
384 return $this->key;
385 }
386
394 public function getParams() {
395 return $this->parameters;
396 }
397
406 public function getFormat() {
407 wfDeprecated( __METHOD__, '1.29' );
408 return $this->format;
409 }
410
418 public function getLanguage() {
419 // Defaults to false which means current user language
420 return $this->language ?: RequestContext::getMain()->getLanguage();
421 }
422
435 public static function newFromKey( $key, ...$params ) {
436 return new self( $key, $params );
437 }
438
452 public static function newFromSpecifier( $value ) {
453 $params = [];
454 if ( is_array( $value ) ) {
455 $params = $value;
456 $value = array_shift( $params );
457 }
458
459 if ( $value instanceof Message ) { // Message, RawMessage, ApiMessage, etc
460 $message = clone $value;
461 } elseif ( $value instanceof MessageSpecifier ) {
462 $message = new Message( $value );
463 } elseif ( is_string( $value ) ) {
464 $message = new Message( $value, $params );
465 } else {
466 throw new InvalidArgumentException( __METHOD__ . ': invalid argument type '
467 . gettype( $value ) );
468 }
469
470 return $message;
471 }
472
485 public static function newFallbackSequence( ...$keys ) {
486 if ( func_num_args() == 1 ) {
487 if ( is_array( $keys[0] ) ) {
488 // Allow an array to be passed as the first argument instead
489 $keys = array_values( $keys[0] );
490 } else {
491 // Optimize a single string to not need special fallback handling
492 $keys = $keys[0];
493 }
494 }
495 return new self( $keys );
496 }
497
508 public function getTitle() {
510
511 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
512 $lang = $this->getLanguage();
513 $title = $this->key;
514 if (
515 !$lang->equals( $contLang )
516 && in_array( $this->key, (array)$wgForceUIMsgAsContentMsg )
517 ) {
518 $title .= '/' . $lang->getCode();
519 }
520
521 return Title::makeTitle(
522 NS_MEDIAWIKI, $contLang->ucfirst( strtr( $title, ' ', '_' ) ) );
523 }
524
535 public function params( ...$args ) {
536 // If $args has only one entry and it's an array, then it's either a
537 // non-varargs call or it happens to be a call with just a single
538 // "special" parameter. Since the "special" parameters don't have any
539 // numeric keys, we'll test that to differentiate the cases.
540 if ( count( $args ) === 1 && isset( $args[0] ) && is_array( $args[0] ) ) {
541 if ( $args[0] === [] ) {
542 $args = [];
543 } else {
544 foreach ( $args[0] as $key => $value ) {
545 if ( is_int( $key ) ) {
546 $args = $args[0];
547 break;
548 }
549 }
550 }
551 }
552
553 $this->parameters = array_merge( $this->parameters, array_values( $args ) );
554 return $this;
555 }
556
570 public function rawParams( ...$params ) {
571 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
572 $params = $params[0];
573 }
574 foreach ( $params as $param ) {
575 $this->parameters[] = self::rawParam( $param );
576 }
577 return $this;
578 }
579
591 public function numParams( ...$params ) {
592 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
593 $params = $params[0];
594 }
595 foreach ( $params as $param ) {
596 $this->parameters[] = self::numParam( $param );
597 }
598 return $this;
599 }
600
612 public function durationParams( ...$params ) {
613 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
614 $params = $params[0];
615 }
616 foreach ( $params as $param ) {
617 $this->parameters[] = self::durationParam( $param );
618 }
619 return $this;
620 }
621
633 public function expiryParams( ...$params ) {
634 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
635 $params = $params[0];
636 }
637 foreach ( $params as $param ) {
638 $this->parameters[] = self::expiryParam( $param );
639 }
640 return $this;
641 }
642
654 public function timeperiodParams( ...$params ) {
655 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
656 $params = $params[0];
657 }
658 foreach ( $params as $param ) {
659 $this->parameters[] = self::timeperiodParam( $param );
660 }
661 return $this;
662 }
663
675 public function sizeParams( ...$params ) {
676 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
677 $params = $params[0];
678 }
679 foreach ( $params as $param ) {
680 $this->parameters[] = self::sizeParam( $param );
681 }
682 return $this;
683 }
684
696 public function bitrateParams( ...$params ) {
697 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
698 $params = $params[0];
699 }
700 foreach ( $params as $param ) {
701 $this->parameters[] = self::bitrateParam( $param );
702 }
703 return $this;
704 }
705
719 public function plaintextParams( ...$params ) {
720 if ( isset( $params[0] ) && is_array( $params[0] ) ) {
721 $params = $params[0];
722 }
723 foreach ( $params as $param ) {
724 $this->parameters[] = self::plaintextParam( $param );
725 }
726 return $this;
727 }
728
738 public function setContext( IContextSource $context ) {
739 $this->inLanguage( $context->getLanguage() );
740 $this->title( $context->getTitle() );
741 $this->interface = true;
742
743 return $this;
744 }
745
757 public function inLanguage( $lang ) {
758 $previousLanguage = $this->language;
759
760 if ( $lang instanceof Language ) {
761 $this->language = $lang;
762 } elseif ( is_string( $lang ) ) {
763 if ( !$this->language instanceof Language || $this->language->getCode() != $lang ) {
764 $this->language = MediaWikiServices::getInstance()->getLanguageFactory()
765 ->getLanguage( $lang );
766 }
767 } elseif ( $lang instanceof StubUserLang ) {
768 $this->language = false;
769 } else {
770 $type = gettype( $lang );
771 throw new MWException( __METHOD__ . " must be "
772 . "passed a String or Language object; $type given"
773 );
774 }
775
776 if ( $this->language !== $previousLanguage ) {
777 // The language has changed. Clear the message cache.
778 $this->message = null;
779 }
780 $this->interface = false;
781 return $this;
782 }
783
793 public function inContentLanguage() {
795 if ( in_array( $this->key, (array)$wgForceUIMsgAsContentMsg ) ) {
796 return $this;
797 }
798
799 $this->inLanguage( MediaWikiServices::getInstance()->getContentLanguage() );
800 return $this;
801 }
802
813 public function setInterfaceMessageFlag( $interface ) {
814 $this->interface = (bool)$interface;
815 return $this;
816 }
817
827 public function useDatabase( $useDatabase ) {
828 $this->useDatabase = (bool)$useDatabase;
829 $this->message = null;
830 return $this;
831 }
832
842 public function title( $title ) {
843 $this->title = $title;
844 return $this;
845 }
846
852 public function content() {
853 if ( !$this->content ) {
854 $this->content = new MessageContent( $this );
855 }
856
857 return $this->content;
858 }
859
871 public function toString( $format = null ) {
872 if ( $format === null ) {
873 $ex = new LogicException( __METHOD__ . ' using implicit format: ' . $this->format );
874 LoggerFactory::getInstance( 'message-format' )->warning(
875 $ex->getMessage(), [ 'exception' => $ex, 'format' => $this->format, 'key' => $this->key ] );
876 $format = $this->format;
877 }
878 $string = $this->fetchMessage();
879
880 if ( $string === false ) {
881 // Err on the side of safety, ensure that the output
882 // is always html safe in the event the message key is
883 // missing, since in that case its highly likely the
884 // message key is user-controlled.
885 // '⧼' is used instead of '<' to side-step any
886 // double-escaping issues.
887 // (Keep synchronised with mw.Message#toString in JS.)
888 return '⧼' . htmlspecialchars( $this->key ) . '⧽';
889 }
890
891 # Replace $* with a list of parameters for &uselang=qqx.
892 if ( strpos( $string, '$*' ) !== false ) {
893 $paramlist = '';
894 if ( $this->parameters !== [] ) {
895 $paramlist = ': $' . implode( ', $', range( 1, count( $this->parameters ) ) );
896 }
897 $string = str_replace( '$*', $paramlist, $string );
898 }
899
900 # Replace parameters before text parsing
901 $string = $this->replaceParameters( $string, 'before', $format );
902
903 # Maybe transform using the full parser
904 if ( $format === self::FORMAT_PARSE ) {
905 $string = $this->parseText( $string );
906 $string = Parser::stripOuterParagraph( $string );
907 } elseif ( $format === self::FORMAT_BLOCK_PARSE ) {
908 $string = $this->parseText( $string );
909 } elseif ( $format === self::FORMAT_TEXT ) {
910 $string = $this->transformText( $string );
911 } elseif ( $format === self::FORMAT_ESCAPED ) {
912 $string = $this->transformText( $string );
913 $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false );
914 }
915
916 # Raw parameter replacement
917 $string = $this->replaceParameters( $string, 'after', $format );
918
919 return $string;
920 }
921
931 public function __toString() {
932 // PHP doesn't allow __toString to throw exceptions and will
933 // trigger a fatal error if it does. So, catch any exceptions.
934
935 try {
936 return $this->toString( self::FORMAT_PARSE );
937 } catch ( Exception $ex ) {
938 try {
939 trigger_error( "Exception caught in " . __METHOD__ . " (message " . $this->key . "): "
940 . $ex, E_USER_WARNING );
941 } catch ( Exception $ex ) {
942 // Doh! Cause a fatal error after all?
943 }
944
945 return '⧼' . htmlspecialchars( $this->key ) . '⧽';
946 }
947 }
948
956 public function parse() {
957 $this->format = self::FORMAT_PARSE;
958 return $this->toString( self::FORMAT_PARSE );
959 }
960
968 public function text() {
969 $this->format = self::FORMAT_TEXT;
970 return $this->toString( self::FORMAT_TEXT );
971 }
972
980 public function plain() {
981 $this->format = self::FORMAT_PLAIN;
982 return $this->toString( self::FORMAT_PLAIN );
983 }
984
992 public function parseAsBlock() {
993 $this->format = self::FORMAT_BLOCK_PARSE;
994 return $this->toString( self::FORMAT_BLOCK_PARSE );
995 }
996
1005 public function escaped() {
1006 $this->format = self::FORMAT_ESCAPED;
1007 return $this->toString( self::FORMAT_ESCAPED );
1008 }
1009
1017 public function exists() {
1018 return $this->fetchMessage() !== false;
1019 }
1020
1029 public function isBlank() {
1030 $message = $this->fetchMessage();
1031 return $message === false || $message === '';
1032 }
1033
1041 public function isDisabled() {
1042 $message = $this->fetchMessage();
1043 return $message === false || $message === '' || $message === '-';
1044 }
1045
1053 public static function rawParam( $raw ) {
1054 return [ 'raw' => $raw ];
1055 }
1056
1064 public static function numParam( $num ) {
1065 return [ 'num' => $num ];
1066 }
1067
1075 public static function durationParam( $duration ) {
1076 return [ 'duration' => $duration ];
1077 }
1078
1086 public static function expiryParam( $expiry ) {
1087 return [ 'expiry' => $expiry ];
1088 }
1089
1097 public static function timeperiodParam( $period ) {
1098 return [ 'period' => $period ];
1099 }
1100
1108 public static function sizeParam( $size ) {
1109 return [ 'size' => $size ];
1110 }
1111
1119 public static function bitrateParam( $bitrate ) {
1120 return [ 'bitrate' => $bitrate ];
1121 }
1122
1130 public static function plaintextParam( $plaintext ) {
1131 return [ 'plaintext' => $plaintext ];
1132 }
1133
1141 public static function listParam( array $list, $type = 'text' ) {
1142 if ( !isset( self::$listTypeMap[$type] ) ) {
1143 throw new InvalidArgumentException(
1144 "Invalid type '$type'. Known types are: " . implode( ', ', array_keys( self::$listTypeMap ) )
1145 );
1146 }
1147 return [ 'list' => $list, 'type' => $type ];
1148 }
1149
1161 protected function replaceParameters( $message, $type, $format ) {
1162 // A temporary marker for $1 parameters that is only valid
1163 // in non-attribute contexts. However if the entire message is escaped
1164 // then we don't want to use it because it will be mangled in all contexts
1165 // and its unnessary as ->escaped() messages aren't html.
1166 $marker = $format === self::FORMAT_ESCAPED ? '$' : '$\'"';
1167 $replacementKeys = [];
1168 foreach ( $this->parameters as $n => $param ) {
1169 list( $paramType, $value ) = $this->extractParam( $param, $format );
1170 if ( $type === 'before' ) {
1171 if ( $paramType === 'before' ) {
1172 $replacementKeys['$' . ( $n + 1 )] = $value;
1173 } else /* $paramType === 'after' */ {
1174 // To protect against XSS from replacing parameters
1175 // inside html attributes, we convert $1 to $'"1.
1176 // In the event that one of the parameters ends up
1177 // in an attribute, either the ' or the " will be
1178 // escaped, breaking the replacement and avoiding XSS.
1179 $replacementKeys['$' . ( $n + 1 )] = $marker . ( $n + 1 );
1180 }
1181 } elseif ( $paramType === 'after' ) {
1182 $replacementKeys[$marker . ( $n + 1 )] = $value;
1183 }
1184 }
1185 return strtr( $message, $replacementKeys );
1186 }
1187
1198 protected function extractParam( $param, $format ) {
1199 if ( is_array( $param ) ) {
1200 if ( isset( $param['raw'] ) ) {
1201 return [ 'after', $param['raw'] ];
1202 } elseif ( isset( $param['num'] ) ) {
1203 // Replace number params always in before step for now.
1204 // No support for combined raw and num params
1205 return [ 'before', $this->getLanguage()->formatNum( $param['num'] ) ];
1206 } elseif ( isset( $param['duration'] ) ) {
1207 return [ 'before', $this->getLanguage()->formatDuration( $param['duration'] ) ];
1208 } elseif ( isset( $param['expiry'] ) ) {
1209 return [ 'before', $this->getLanguage()->formatExpiry( $param['expiry'] ) ];
1210 } elseif ( isset( $param['period'] ) ) {
1211 return [ 'before', $this->getLanguage()->formatTimePeriod( $param['period'] ) ];
1212 } elseif ( isset( $param['size'] ) ) {
1213 return [ 'before', $this->getLanguage()->formatSize( $param['size'] ) ];
1214 } elseif ( isset( $param['bitrate'] ) ) {
1215 return [ 'before', $this->getLanguage()->formatBitrate( $param['bitrate'] ) ];
1216 } elseif ( isset( $param['plaintext'] ) ) {
1217 return [ 'after', $this->formatPlaintext( $param['plaintext'], $format ) ];
1218 } elseif ( isset( $param['list'] ) ) {
1219 return $this->formatListParam( $param['list'], $param['type'], $format );
1220 } else {
1221 LoggerFactory::getInstance( 'Bug58676' )->warning(
1222 'Invalid parameter for message "{msgkey}": {param}',
1223 [
1224 'exception' => new Exception,
1225 'msgkey' => $this->getKey(),
1226 'param' => htmlspecialchars( serialize( $param ) ),
1227 ]
1228 );
1229
1230 return [ 'before', '[INVALID]' ];
1231 }
1232 } elseif ( $param instanceof Message ) {
1233 // Match language, flags, etc. to the current message.
1234 $msg = clone $param;
1235 if ( $msg->language !== $this->language || $msg->useDatabase !== $this->useDatabase ) {
1236 // Cache depends on these parameters
1237 $msg->message = null;
1238 }
1239 $msg->interface = $this->interface;
1240 $msg->language = $this->language;
1241 $msg->useDatabase = $this->useDatabase;
1242 $msg->title = $this->title;
1243
1244 // DWIM
1245 if ( $format === 'block-parse' ) {
1246 $format = 'parse';
1247 }
1248 $msg->format = $format;
1249
1250 // Message objects should not be before parameters because
1251 // then they'll get double escaped. If the message needs to be
1252 // escaped, it'll happen right here when we call toString().
1253 return [ 'after', $msg->toString( $format ) ];
1254 } else {
1255 return [ 'before', $param ];
1256 }
1257 }
1258
1268 protected function parseText( $string ) {
1269 $out = MediaWikiServices::getInstance()->getMessageCache()->parse(
1270 $string,
1271 $this->title,
1272 /*linestart*/true,
1273 $this->interface,
1274 $this->getLanguage()
1275 );
1276
1277 return $out instanceof ParserOutput
1278 ? $out->getText( [
1279 'enableSectionEditLinks' => false,
1280 // Wrapping messages in an extra <div> is probably not expected. If
1281 // they're outside the content area they probably shouldn't be
1282 // targeted by CSS that's targeting the parser output, and if
1283 // they're inside they already are from the outer div.
1284 'unwrap' => true,
1285 ] )
1286 : $out;
1287 }
1288
1298 protected function transformText( $string ) {
1299 return MediaWikiServices::getInstance()->getMessageCache()->transform(
1300 $string,
1301 $this->interface,
1302 $this->getLanguage(),
1303 $this->title
1304 );
1305 }
1306
1315 protected function fetchMessage() {
1316 if ( $this->message === null ) {
1317 $cache = MediaWikiServices::getInstance()->getMessageCache();
1318
1319 foreach ( $this->keysToTry as $key ) {
1320 $message = $cache->get( $key, $this->useDatabase, $this->getLanguage() );
1321 if ( $message !== false && $message !== '' ) {
1322 break;
1323 }
1324 }
1325
1326 // NOTE: The constructor makes sure keysToTry isn't empty,
1327 // so we know that $key and $message are initialized.
1328 $this->key = $key;
1329 $this->message = $message;
1330 }
1331 return $this->message;
1332 }
1333
1346 protected function formatPlaintext( $plaintext, $format ) {
1347 switch ( $format ) {
1348 case self::FORMAT_TEXT:
1349 case self::FORMAT_PLAIN:
1350 return $plaintext;
1351
1352 case self::FORMAT_PARSE:
1353 case self::FORMAT_BLOCK_PARSE:
1354 case self::FORMAT_ESCAPED:
1355 default:
1356 return htmlspecialchars( $plaintext, ENT_QUOTES );
1357 }
1358 }
1359
1368 protected function formatListParam( array $params, $listType, $format ) {
1369 if ( !isset( self::$listTypeMap[$listType] ) ) {
1370 $warning = 'Invalid list type for message "' . $this->getKey() . '": '
1371 . htmlspecialchars( $listType )
1372 . ' (params are ' . htmlspecialchars( serialize( $params ) ) . ')';
1373 trigger_error( $warning, E_USER_WARNING );
1374 $e = new Exception;
1375 wfDebugLog( 'Bug58676', $warning . "\n" . $e->getTraceAsString() );
1376 return [ 'before', '[INVALID]' ];
1377 }
1378 $func = self::$listTypeMap[$listType];
1379
1380 // Handle an empty list sensibly
1381 if ( !$params ) {
1382 return [ 'before', $this->getLanguage()->$func( [] ) ];
1383 }
1384
1385 // First, determine what kinds of list items we have
1386 $types = [];
1387 $vars = [];
1388 $list = [];
1389 foreach ( $params as $n => $p ) {
1390 list( $type, $value ) = $this->extractParam( $p, $format );
1391 $types[$type] = true;
1392 $list[] = $value;
1393 $vars[] = '$' . ( $n + 1 );
1394 }
1395
1396 // Easy case: all are 'before' or 'after', so just join the
1397 // values and use the same type.
1398 if ( count( $types ) === 1 ) {
1399 return [ key( $types ), $this->getLanguage()->$func( $list ) ];
1400 }
1401
1402 // Hard case: We need to process each value per its type, then
1403 // return the concatenated values as 'after'. We handle this by turning
1404 // the list into a RawMessage and processing that as a parameter.
1405 $vars = $this->getLanguage()->$func( $vars );
1406 return $this->extractParam( new RawMessage( $vars, $params ), $format );
1407 }
1408}
__unserialize( $data)
serialize()
unserialize( $serialized)
$wgForceUIMsgAsContentMsg
When translating messages with wfMessage(), it is not always clear what should be considered UI messa...
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
return[ 'abap'=> true, 'abl'=> true, 'abnf'=> true, 'aconf'=> true, 'actionscript'=> true, 'actionscript3'=> true, 'ada'=> true, 'ada2005'=> true, 'ada95'=> true, 'adl'=> true, 'agda'=> true, 'aheui'=> true, 'ahk'=> true, 'alloy'=> true, 'ambienttalk'=> true, 'ambienttalk/2'=> true, 'ampl'=> true, 'antlr'=> true, 'antlr-actionscript'=> true, 'antlr-as'=> true, 'antlr-c#'=> true, 'antlr-cpp'=> true, 'antlr-csharp'=> true, 'antlr-java'=> true, 'antlr-objc'=> true, 'antlr-perl'=> true, 'antlr-python'=> true, 'antlr-rb'=> true, 'antlr-ruby'=> true, 'apache'=> true, 'apacheconf'=> true, 'apl'=> true, 'applescript'=> true, 'arduino'=> true, 'arexx'=> true, 'arrow'=> true, 'as'=> true, 'as3'=> true, 'asm'=> true, 'aspectj'=> true, 'aspx-cs'=> true, 'aspx-vb'=> true, 'asy'=> true, 'asymptote'=> true, 'at'=> true, 'augeas'=> true, 'autohotkey'=> true, 'autoit'=> true, 'awk'=> true, 'b3d'=> true, 'bare'=> true, 'basemake'=> true, 'bash'=> true, 'basic'=> true, 'bat'=> true, 'batch'=> true, 'bbcbasic'=> true, 'bbcode'=> true, 'bc'=> true, 'befunge'=> true, 'bf'=> true, 'bib'=> true, 'bibtex'=> true, 'blitzbasic'=> true, 'blitzmax'=> true, 'bmax'=> true, 'bnf'=> true, 'boa'=> true, 'boo'=> true, 'boogie'=> true, 'bplus'=> true, 'brainfuck'=> true, 'bro'=> true, 'bsdmake'=> true, 'bst'=> true, 'bst-pybtex'=> true, 'bugs'=> true, 'c'=> true, 'c#'=> true, 'c++'=> true, 'c++-objdumb'=> true, 'c-objdump'=> true, 'ca65'=> true, 'cadl'=> true, 'camkes'=> true, 'capdl'=> true, 'capnp'=> true, 'cbmbas'=> true, 'ceylon'=> true, 'cf3'=> true, 'cfc'=> true, 'cfengine3'=> true, 'cfg'=> true, 'cfm'=> true, 'cfs'=> true, 'chai'=> true, 'chaiscript'=> true, 'chapel'=> true, 'charmci'=> true, 'cheetah'=> true, 'chpl'=> true, 'cirru'=> true, 'cl'=> true, 'clay'=> true, 'clean'=> true, 'clipper'=> true, 'clj'=> true, 'cljs'=> true, 'clojure'=> true, 'clojurescript'=> true, 'cmake'=> true, 'cobol'=> true, 'cobolfree'=> true, 'coffee'=> true, 'coffee-script'=> true, 'coffeescript'=> true, 'common-lisp'=> true, 'componentpascal'=> true, 'console'=> true, 'control'=> true, 'coq'=> true, 'cp'=> true, 'cpp'=> true, 'cpp-objdump'=> true, 'cpsa'=> true, 'cr'=> true, 'crmsh'=> true, 'croc'=> true, 'cry'=> true, 'cryptol'=> true, 'crystal'=> true, 'csh'=> true, 'csharp'=> true, 'csound'=> true, 'csound-csd'=> true, 'csound-document'=> true, 'csound-orc'=> true, 'csound-sco'=> true, 'csound-score'=> true, 'css'=> true, 'css+django'=> true, 'css+erb'=> true, 'css+genshi'=> true, 'css+genshitext'=> true, 'css+jinja'=> true, 'css+lasso'=> true, 'css+mako'=> true, 'css+mozpreproc'=> true, 'css+myghty'=> true, 'css+php'=> true, 'css+ruby'=> true, 'css+smarty'=> true, 'cu'=> true, 'cucumber'=> true, 'cuda'=> true, 'cxx-objdump'=> true, 'cypher'=> true, 'cython'=> true, 'd'=> true, 'd-objdump'=> true, 'dart'=> true, 'dasm16'=> true, 'debcontrol'=> true, 'debsources'=> true, 'delphi'=> true, 'devicetree'=> true, 'dg'=> true, 'diff'=> true, 'django'=> true, 'dmesg'=> true, 'do'=> true, 'docker'=> true, 'dockerfile'=> true, 'dosbatch'=> true, 'doscon'=> true, 'dosini'=> true, 'dpatch'=> true, 'dtd'=> true, 'dts'=> true, 'duby'=> true, 'duel'=> true, 'dylan'=> true, 'dylan-console'=> true, 'dylan-lid'=> true, 'dylan-repl'=> true, 'earl-grey'=> true, 'earlgrey'=> true, 'easytrieve'=> true, 'ebnf'=> true, 'ec'=> true, 'ecl'=> true, 'eg'=> true, 'eiffel'=> true, 'elisp'=> true, 'elixir'=> true, 'elm'=> true, 'emacs'=> true, 'emacs-lisp'=> true, 'email'=> true, 'eml'=> true, 'erb'=> true, 'erl'=> true, 'erlang'=> true, 'evoque'=> true, 'ex'=> true, 'execline'=> true, 'exs'=> true, 'extempore'=> true, 'ezhil'=> true, 'f#'=> true, 'factor'=> true, 'fan'=> true, 'fancy'=> true, 'felix'=> true, 'fennel'=> true, 'fish'=> true, 'fishshell'=> true, 'flatline'=> true, 'flo'=> true, 'floscript'=> true, 'flx'=> true, 'fnl'=> true, 'forth'=> true, 'fortran'=> true, 'fortranfixed'=> true, 'foxpro'=> true, 'freefem'=> true, 'fsharp'=> true, 'fstar'=> true, 'fy'=> true, 'gap'=> true, 'gas'=> true, 'gawk'=> true, 'gd'=> true, 'gdscript'=> true, 'genshi'=> true, 'genshitext'=> true, 'gherkin'=> true, 'glsl'=> true, 'gnuplot'=> true, 'go'=> true, 'golo'=> true, 'gooddata-cl'=> true, 'gosu'=> true, 'groff'=> true, 'groovy'=> true, 'gst'=> true, 'haml'=> true, 'handlebars'=> true, 'haskell'=> true, 'haxe'=> true, 'haxeml'=> true, 'hexdump'=> true, 'hlsl'=> true, 'hs'=> true, 'hsa'=> true, 'hsail'=> true, 'hspec'=> true, 'html'=> true, 'html+cheetah'=> true, 'html+django'=> true, 'html+erb'=> true, 'html+evoque'=> true, 'html+genshi'=> true, 'html+handlebars'=> true, 'html+jinja'=> true, 'html+kid'=> true, 'html+lasso'=> true, 'html+mako'=> true, 'html+myghty'=> true, 'html+ng2'=> true, 'html+php'=> true, 'html+ruby'=> true, 'html+smarty'=> true, 'html+spitfire'=> true, 'html+twig'=> true, 'html+velocity'=> true, 'htmlcheetah'=> true, 'htmldjango'=> true, 'http'=> true, 'hx'=> true, 'hxml'=> true, 'hxsl'=> true, 'hy'=> true, 'hybris'=> true, 'hylang'=> true, 'i6'=> true, 'i6t'=> true, 'i7'=> true, 'icon'=> true, 'idl'=> true, 'idl4'=> true, 'idr'=> true, 'idris'=> true, 'iex'=> true, 'igor'=> true, 'igorpro'=> true, 'ik'=> true, 'inform6'=> true, 'inform7'=> true, 'ini'=> true, 'io'=> true, 'ioke'=> true, 'irb'=> true, 'irc'=> true, 'isabelle'=> true, 'j'=> true, 'jade'=> true, 'jags'=> true, 'jasmin'=> true, 'jasminxt'=> true, 'java'=> true, 'javascript'=> true, 'javascript+cheetah'=> true, 'javascript+django'=> true, 'javascript+erb'=> true, 'javascript+genshi'=> true, 'javascript+genshitext'=> true, 'javascript+jinja'=> true, 'javascript+lasso'=> true, 'javascript+mako'=> true, 'javascript+mozpreproc'=> true, 'javascript+myghty'=> true, 'javascript+php'=> true, 'javascript+ruby'=> true, 'javascript+smarty'=> true, 'javascript+spitfire'=> true, 'jbst'=> true, 'jcl'=> true, 'jinja'=> true, 'jl'=> true, 'jlcon'=> true, 'jproperties'=> true, 'js'=> true, 'js+cheetah'=> true, 'js+django'=> true, 'js+erb'=> true, 'js+genshi'=> true, 'js+genshitext'=> true, 'js+jinja'=> true, 'js+lasso'=> true, 'js+mako'=> true, 'js+myghty'=> true, 'js+php'=> true, 'js+ruby'=> true, 'js+smarty'=> true, 'js+spitfire'=> true, 'jsgf'=> true, 'json'=> true, 'json-ld'=> true, 'json-object'=> true, 'jsonld'=> true, 'jsonml+bst'=> true, 'jsp'=> true, 'julia'=> true, 'juttle'=> true, 'kal'=> true, 'kconfig'=> true, 'kernel-config'=> true, 'kid'=> true, 'kmsg'=> true, 'koka'=> true, 'kotlin'=> true, 'ksh'=> true, 'lagda'=> true, 'lasso'=> true, 'lassoscript'=> true, 'latex'=> true, 'lcry'=> true, 'lcryptol'=> true, 'lean'=> true, 'less'=> true, 'lhaskell'=> true, 'lhs'=> true, 'lid'=> true, 'lidr'=> true, 'lidris'=> true, 'lighttpd'=> true, 'lighty'=> true, 'limbo'=> true, 'linux-config'=> true, 'liquid'=> true, 'lisp'=> true, 'literate-agda'=> true, 'literate-cryptol'=> true, 'literate-haskell'=> true, 'literate-idris'=> true, 'live-script'=> true, 'livescript'=> true, 'llvm'=> true, 'llvm-mir'=> true, 'llvm-mir-body'=> true, 'logos'=> true, 'logtalk'=> true, 'lsl'=> true, 'lua'=> true, 'm2'=> true, 'make'=> true, 'makefile'=> true, 'mako'=> true, 'man'=> true, 'maql'=> true, 'mask'=> true, 'mason'=> true, 'mathematica'=> true, 'matlab'=> true, 'matlabsession'=> true, 'mawk'=> true, 'md'=> true, 'menuconfig'=> true, 'mf'=> true, 'mime'=> true, 'minid'=> true, 'miniscript'=> true, 'mma'=> true, 'modelica'=> true, 'modula2'=> true, 'moin'=> true, 'monkey'=> true, 'monte'=> true, 'moo'=> true, 'moocode'=> true, 'moon'=> true, 'moonscript'=> true, 'mosel'=> true, 'mozhashpreproc'=> true, 'mozpercentpreproc'=> true, 'mq4'=> true, 'mq5'=> true, 'mql'=> true, 'mql4'=> true, 'mql5'=> true, 'ms'=> true, 'msc'=> true, 'mscgen'=> true, 'mupad'=> true, 'mxml'=> true, 'myghty'=> true, 'mysql'=> true, 'nasm'=> true, 'nawk'=> true, 'nb'=> true, 'ncl'=> true, 'nemerle'=> true, 'nesc'=> true, 'newlisp'=> true, 'newspeak'=> true, 'ng2'=> true, 'nginx'=> true, 'nim'=> true, 'nimrod'=> true, 'nit'=> true, 'nix'=> true, 'nixos'=> true, 'notmuch'=> true, 'nroff'=> true, 'nsh'=> true, 'nsi'=> true, 'nsis'=> true, 'numpy'=> true, 'nusmv'=> true, 'obj-c'=> true, 'obj-c++'=> true, 'obj-j'=> true, 'objc'=> true, 'objc++'=> true, 'objdump'=> true, 'objdump-nasm'=> true, 'objective-c'=> true, 'objective-c++'=> true, 'objective-j'=> true, 'objectivec'=> true, 'objectivec++'=> true, 'objectivej'=> true, 'objectpascal'=> true, 'objj'=> true, 'ocaml'=> true, 'octave'=> true, 'odin'=> true, 'ooc'=> true, 'opa'=> true, 'openbugs'=> true, 'openedge'=> true, 'pacmanconf'=> true, 'pan'=> true, 'parasail'=> true, 'pas'=> true, 'pascal'=> true, 'pawn'=> true, 'pcmk'=> true, 'peg'=> true, 'perl'=> true, 'perl6'=> true, 'php'=> true, 'php3'=> true, 'php4'=> true, 'php5'=> true, 'pig'=> true, 'pike'=> true, 'pkgconfig'=> true, 'pl'=> true, 'pl6'=> true, 'plpgsql'=> true, 'po'=> true, 'pointless'=> true, 'pony'=> true, 'posh'=> true, 'postgres'=> true, 'postgres-console'=> true, 'postgresql'=> true, 'postgresql-console'=> true, 'postscr'=> true, 'postscript'=> true, 'pot'=> true, 'pov'=> true, 'powershell'=> true, 'praat'=> true, 'progress'=> true, 'prolog'=> true, 'promql'=> true, 'properties'=> true, 'proto'=> true, 'protobuf'=> true, 'ps1'=> true, 'ps1con'=> true, 'psm1'=> true, 'psql'=> true, 'psysh'=> true, 'pug'=> true, 'puppet'=> true, 'py'=> true, 'py2'=> true, 'py2tb'=> true, 'py3'=> true, 'py3tb'=> true, 'pycon'=> true, 'pypy'=> true, 'pypylog'=> true, 'pyrex'=> true, 'pytb'=> true, 'python'=> true, 'python2'=> true, 'python3'=> true, 'pyx'=> true, 'qbasic'=> true, 'qbs'=> true, 'qml'=> true, 'qvt'=> true, 'qvto'=> true, 'r'=> true, 'racket'=> true, 'ragel'=> true, 'ragel-c'=> true, 'ragel-cpp'=> true, 'ragel-d'=> true, 'ragel-em'=> true, 'ragel-java'=> true, 'ragel-objc'=> true, 'ragel-rb'=> true, 'ragel-ruby'=> true, 'raku'=> true, 'raw'=> true, 'rb'=> true, 'rbcon'=> true, 'rconsole'=> true, 'rd'=> true, 'reason'=> true, 'reasonml'=> true, 'rebol'=> true, 'red'=> true, 'red/system'=> true, 'redcode'=> true, 'registry'=> true, 'resource'=> true, 'resourcebundle'=> true, 'rest'=> true, 'restructuredtext'=> true, 'rexx'=> true, 'rhtml'=> true, 'ride'=> true, 'rkt'=> true, 'rnc'=> true, 'rng-compact'=> true, 'roboconf-graph'=> true, 'roboconf-instances'=> true, 'robotframework'=> true, 'rout'=> true, 'rql'=> true, 'rs'=> true, 'rsl'=> true, 'rst'=> true, 'rts'=> true, 'ruby'=> true, 'rust'=> true, 's'=> true, 'sage'=> true, 'salt'=> true, 'sarl'=> true, 'sas'=> true, 'sass'=> true, 'sbatch'=> true, 'sc'=> true, 'scala'=> true, 'scaml'=> true, 'scd'=> true, 'scdoc'=> true, 'scheme'=> true, 'scilab'=> true, 'scm'=> true, 'scss'=> true, 'sgf'=> true, 'sh'=> true, 'shell'=> true, 'shell-session'=> true, 'shen'=> true, 'shex'=> true, 'shexc'=> true, 'sieve'=> true, 'silver'=> true, 'singularity'=> true, 'slash'=> true, 'slim'=> true, 'sls'=> true, 'slurm'=> true, 'smali'=> true, 'smalltalk'=> true, 'smarty'=> true, 'sml'=> true, 'snobol'=> true, 'snowball'=> true, 'solidity'=> true, 'sources.list'=> true, 'sourceslist'=> true, 'sp'=> true, 'sparql'=> true, 'spec'=> true, 'spitfire'=> true, 'splus'=> true, 'sql'=> true, 'sqlite3'=> true, 'squeak'=> true, 'squid'=> true, 'squid.conf'=> true, 'squidconf'=> true, 'ssp'=> true, 'st'=> true, 'stan'=> true, 'stata'=> true, 'supercollider'=> true, 'sv'=> true, 'swift'=> true, 'swig'=> true, 'systemverilog'=> true, 't-sql'=> true, 'tads3'=> true, 'tap'=> true, 'tasm'=> true, 'tcl'=> true, 'tcsh'=> true, 'tcshcon'=> true, 'tea'=> true, 'teraterm'=> true, 'teratermmacro'=> true, 'termcap'=> true, 'terminfo'=> true, 'terraform'=> true, 'tex'=> true, 'text'=> true, 'tf'=> true, 'thrift'=> true, 'tid'=> true, 'tnt'=> true, 'todotxt'=> true, 'toml'=> true, 'trac-wiki'=> true, 'trafficscript'=> true, 'treetop'=> true, 'ts'=> true, 'tsql'=> true, 'ttl'=> true, 'turtle'=> true, 'twig'=> true, 'typescript'=> true, 'typoscript'=> true, 'typoscriptcssdata'=> true, 'typoscripthtmldata'=> true, 'ucode'=> true, 'udiff'=> true, 'unicon'=> true, 'urbiscript'=> true, 'usd'=> true, 'usda'=> true, 'v'=> true, 'vala'=> true, 'vapi'=> true, 'vb.net'=> true, 'vbnet'=> true, 'vbscript'=> true, 'vcl'=> true, 'vclsnippet'=> true, 'vclsnippets'=> true, 'vctreestatus'=> true, 'velocity'=> true, 'verilog'=> true, 'vfp'=> true, 'vgl'=> true, 'vhdl'=> true, 'vim'=> true, 'wdiff'=> true, 'webidl'=> true, 'whiley'=> true, 'winbatch'=> true, 'winbugs'=> true, 'x10'=> true, 'xbase'=> true, 'xml'=> true, 'xml+cheetah'=> true, 'xml+django'=> true, 'xml+erb'=> true, 'xml+evoque'=> true, 'xml+genshi'=> true, 'xml+jinja'=> true, 'xml+kid'=> true, 'xml+lasso'=> true, 'xml+mako'=> true, 'xml+myghty'=> true, 'xml+php'=> true, 'xml+ruby'=> true, 'xml+smarty'=> true, 'xml+spitfire'=> true, 'xml+velocity'=> true, 'xorg.conf'=> true, 'xq'=> true, 'xql'=> true, 'xqm'=> true, 'xquery'=> true, 'xqy'=> true, 'xslt'=> true, 'xten'=> true, 'xtend'=> true, 'xul+mozpreproc'=> true, 'yaml'=> true, 'yaml+jinja'=> true, 'yang'=> true, 'zeek'=> true, 'zephir'=> true, 'zig'=> true, 'zsh'=> true,]
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition Language.php:41
getCode()
Get the internal language code for this language object.
MediaWiki exception.
PSR-3 logger instance factory.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Wrapper allowing us to handle a system message as a Content object.
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:161
static newFallbackSequence(... $keys)
Factory function accepting multiple message keys and returning a message instance for the first messa...
Definition Message.php:485
sizeParams(... $params)
Add parameters that are file sizes and will be passed through Language::formatSize before substitutio...
Definition Message.php:675
extractParam( $param, $format)
Extracts the parameter type and preprocessed the value if needed.
Definition Message.php:1198
static listParam(array $list, $type='text')
Definition Message.php:1141
params(... $args)
Adds parameters to the parameter list of this message.
Definition Message.php:535
const FORMAT_TEXT
Transform {{..}} constructs but don't transform to HTML.
Definition Message.php:169
transformText( $string)
Wrapper for what ever method we use to {{-transform wikitext.
Definition Message.php:1298
static rawParam( $raw)
Definition Message.php:1053
getParams()
Returns the message parameters.
Definition Message.php:394
static bitrateParam( $bitrate)
Definition Message.php:1119
static array $listTypeMap
Mapping from Message::listParam() types to Language methods.
Definition Message.php:177
isMultiKey()
Definition Message.php:358
durationParams(... $params)
Add parameters that are durations of time and will be passed through Language::formatDuration before ...
Definition Message.php:612
__unserialize( $data)
Definition Message.php:327
isBlank()
Check whether a message does not exist, or is an empty string.
Definition Message.php:1029
expiryParams(... $params)
Add parameters that are expiration times and will be passed through Language::formatExpiry before sub...
Definition Message.php:633
setInterfaceMessageFlag( $interface)
Allows manipulating the interface message flag directly.
Definition Message.php:813
plaintextParams(... $params)
Add parameters that are plaintext and will be passed through without the content being evaluated.
Definition Message.php:719
bitrateParams(... $params)
Add parameters that are bitrates and will be passed through Language::formatBitrate before substituti...
Definition Message.php:696
parseAsBlock()
Returns the parsed message text which is always surrounded by a block element.
Definition Message.php:992
__construct( $key, $params=[], Language $language=null)
Stable to call.
Definition Message.php:251
bool $useDatabase
Whether database can be used.
Definition Message.php:224
getKeysToTry()
Definition Message.php:368
parse()
Fully parse the text from wikitext to HTML.
Definition Message.php:956
const FORMAT_PARSE
Use normal wikitext -> HTML parsing but strip the block-level wrapper.
Definition Message.php:167
__toString()
Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg: $foo = new Message( $k...
Definition Message.php:931
unserialize( $serialized)
Definition Message.php:318
const FORMAT_BLOCK_PARSE
Use normal wikitext -> HTML parsing (the result will be wrapped in a block-level HTML tag)
Definition Message.php:165
static sizeParam( $size)
Definition Message.php:1108
formatListParam(array $params, $listType, $format)
Formats a list of parameters as a concatenated string.
Definition Message.php:1368
static timeperiodParam( $period)
Definition Message.php:1097
array $parameters
List of parameters which will be substituted into the message.
Definition Message.php:213
static plaintextParam( $plaintext)
Definition Message.php:1130
__serialize()
Definition Message.php:294
const FORMAT_PLAIN
Use message text as-is.
Definition Message.php:163
static durationParam( $duration)
Definition Message.php:1075
rawParams(... $params)
Add parameters that are substituted after parsing or escaping.
Definition Message.php:570
const FORMAT_ESCAPED
Transform {{..}} constructs, HTML-escape the result.
Definition Message.php:171
inLanguage( $lang)
Request the message in any language that is supported.
Definition Message.php:757
replaceParameters( $message, $type, $format)
Substitutes any parameters into the message text.
Definition Message.php:1161
string $key
The message key.
Definition Message.php:203
numParams(... $params)
Add parameters that are numeric and will be passed through Language::formatNum before substitution.
Definition Message.php:591
static numParam( $num)
Definition Message.php:1064
inContentLanguage()
Request the message in the wiki's content language, unless it is disabled for this message.
Definition Message.php:793
plain()
Returns the message text as-is, only parameters are substituted.
Definition Message.php:980
exists()
Check whether a message key has been defined currently.
Definition Message.php:1017
Content $content
Content object representing the message.
Definition Message.php:234
static newFromKey( $key,... $params)
Factory function that is just wrapper for the real constructor.
Definition Message.php:435
title( $title)
Set the Title object to use as context when transforming the message.
Definition Message.php:842
Language bool $language
In which language to get this message.
Definition Message.php:197
getFormat()
Returns the message format.
Definition Message.php:406
useDatabase( $useDatabase)
Enable or disable database use.
Definition Message.php:827
fetchMessage()
Wrapper for what ever method we use to get message contents.
Definition Message.php:1315
content()
Returns the message as a Content object.
Definition Message.php:852
formatPlaintext( $plaintext, $format)
Formats a message parameter wrapped with 'plaintext'.
Definition Message.php:1346
timeperiodParams(... $params)
Add parameters that are time periods and will be passed through Language::formatTimePeriod before sub...
Definition Message.php:654
getTitle()
Get a title object for a mediawiki message, where it can be found in the mediawiki namespace.
Definition Message.php:508
parseText( $string)
Wrapper for what ever method we use to parse wikitext.
Definition Message.php:1268
getKey()
Returns the message key.
Definition Message.php:383
isDisabled()
Check whether a message does not exist, is an empty string, or is "-".
Definition Message.php:1041
escaped()
Returns the message text.
Definition Message.php:1005
getLanguage()
Returns the Language of the Message.
Definition Message.php:418
string $format
Definition Message.php:219
string $message
Definition Message.php:239
string[] $keysToTry
List of keys to try when fetching the message.
Definition Message.php:208
serialize()
Definition Message.php:285
setContext(IContextSource $context)
Set the language and the title from a context object.
Definition Message.php:738
toString( $format=null)
Returns the message parsed from wikitext to HTML.
Definition Message.php:871
Title $title
Title object to use as context.
Definition Message.php:229
text()
Returns the message text.
Definition Message.php:968
static newFromSpecifier( $value)
Transform a MessageSpecifier or a primitive value used interchangeably with specifiers (a message key...
Definition Message.php:452
bool $interface
In which language to get this message.
Definition Message.php:190
static expiryParam( $expiry)
Definition Message.php:1086
getText( $options=[])
Get the output HTML.
Variant of the Message class.
Stub object for the user language.
Represents a title within MediaWiki.
Definition Title.php:42
const NS_MEDIAWIKI
Definition Defines.php:78
Base interface for content objects.
Definition Content.php:35
Interface for objects which can provide a MediaWiki context on request.
Stable for implementing.
$cache
Definition mcc.php:33
if( $line===false) $args
Definition mcc.php:124
$content
Definition router.php:76
return true
Definition router.php:92
foreach( $res as $row) $serialized
if(!isset( $args[0])) $lang