59 # @todo FIXME: We have a whole bunch of handling here that doesn't happen in
60 # getExternalLinkAttributes, why?
106 $title = $nt->getPrefixedText();
126 $class = htmlspecialchars( $class );
128 if ( $class !=
'' ) {
129 $r .=
" class=\"$class\"";
132 $r .=
" title=\"$title\"";
149 $services = MediaWikiServices::getInstance();
206 if ( !$target instanceof
Title ) {
207 wfWarn( __METHOD__ .
': Requires $target to be a Title object.', 2 );
208 return "<!-- ERROR -->$html";
211 if ( is_string(
$query ) ) {
213 wfDeprecated( __METHOD__ .
' with parameter $query as string (should be array)',
'1.20' );
217 $services = MediaWikiServices::getInstance();
221 if ( !isset(
$options[
'stubThreshold'] ) ) {
222 $defaultLinkRenderer =
$services->getLinkRenderer();
223 $options[
'stubThreshold'] = $defaultLinkRenderer->getStubThreshold();
226 ->createFromLegacyOptions(
$options );
231 if (
$html !==
null ) {
236 if ( in_array(
'known',
$options,
true ) ) {
238 } elseif ( in_array(
'broken',
$options,
true ) ) {
240 } elseif ( in_array(
'noclasses',
$options,
true ) ) {
278 $ret =
"<strong class=\"selflink\">{$prefix}{$html}</strong>{$trail}";
279 if ( !Hooks::run(
'SelfLinkBegin', [ $nt, &
$html, &$trail, &$prefix, &
$ret ] ) ) {
284 $html = htmlspecialchars( $nt->getPrefixedText() );
287 return "<strong class=\"selflink\">{$prefix}{$html}{$inside}</strong>{$trail}";
304 if ( MWNamespace::exists( $namespace ) ) {
312 return $context->msg(
'invalidtitle-unknownnamespace', $namespace,
$title )->text();
343 $basename = strrchr( $url,
'/' );
344 if (
false === $basename ) {
347 $basename = substr( $basename, 1 );
367 $success = Hooks::run(
'LinkerMakeExternalImage', [ &$url, &$alt, &$img ] );
369 wfDebug(
"Hook LinkerMakeExternalImage changed the output of external image "
370 .
"with url {$url} and alt text {$alt} to {$img}\n",
true );
373 return Html::element(
'img',
417 $query =
"", $widthOption =
null
421 if ( !Hooks::run(
'ImageBeforeProduceHTML', [ &$dummy, &
$title,
426 if ( $file && !$file->allowInlineDisplay() ) {
427 wfDebug( __METHOD__ .
': ' .
$title->getPrefixedDBkey() .
" does not allow inline display\n" );
433 if ( !isset( $frameParams[
'align'] ) ) {
434 $frameParams[
'align'] =
'';
436 if ( !isset( $frameParams[
'alt'] ) ) {
437 $frameParams[
'alt'] =
'';
439 if ( !isset( $frameParams[
'title'] ) ) {
440 $frameParams[
'title'] =
'';
442 if ( !isset( $frameParams[
'class'] ) ) {
443 $frameParams[
'class'] =
'';
446 $prefix = $postfix =
'';
448 if (
'center' == $frameParams[
'align'] ) {
449 $prefix =
'<div class="center">';
451 $frameParams[
'align'] =
'none';
454 if ( isset(
$handlerParams[
'height'] ) && $file->isVectorized() ) {
463 if ( isset( $frameParams[
'thumbnail'] )
464 || isset( $frameParams[
'manualthumb'] )
465 || isset( $frameParams[
'framed'] )
466 || isset( $frameParams[
'frameless'] )
471 if ( $widthOption ===
null || !isset(
$wgThumbLimits[$widthOption] ) ) {
472 $widthOption = User::getDefaultOption(
'thumbsize' );
476 if ( isset( $frameParams[
'upright'] ) && $frameParams[
'upright'] == 0 ) {
483 $prefWidth = isset( $frameParams[
'upright'] ) ?
484 round(
$wgThumbLimits[$widthOption] * $frameParams[
'upright'], -1 ) :
490 $prefWidth <
$handlerParams[
'width'] || $file->isVectorized() ) ) {
496 if ( isset( $frameParams[
'thumbnail'] ) || isset( $frameParams[
'manualthumb'] )
497 || isset( $frameParams[
'framed'] )
499 # Create a thumbnail. Alignment depends on the writing direction of
500 # the page content language (right-aligned for LTR languages,
501 # left-aligned for RTL languages)
502 # If a thumbnail width has not been provided, it is set
503 # to the default user option as specified in Language*.php
504 if ( $frameParams[
'align'] ==
'' ) {
505 $frameParams[
'align'] =
$parser->getTargetLanguage()->alignEnd();
512 if ( $file && isset( $frameParams[
'frameless'] ) ) {
513 $srcWidth = $file->getWidth(
$page );
514 # For "frameless" option: do not present an image bigger than the
515 # source (for bitmap-style images). This is the same behavior as the
516 # "thumb" option does it already.
517 if ( $srcWidth && !$file->mustRender() &&
$handlerParams[
'width'] > $srcWidth ) {
523 # Create a resized image, without the additional thumbnail features
534 'alt' => $frameParams[
'alt'],
535 'title' => $frameParams[
'title'],
536 'valign' => isset( $frameParams[
'valign'] ) ? $frameParams[
'valign'] :
false,
537 'img-class' => $frameParams[
'class'] ];
538 if ( isset( $frameParams[
'border'] ) ) {
539 $params[
'img-class'] .= (
$params[
'img-class'] !==
'' ?
' ' :
'' ) .
'thumbborder';
545 if ( $frameParams[
'align'] !=
'' ) {
546 $s =
"<div class=\"float{$frameParams['align']}\">{$s}</div>";
548 return str_replace(
"\n",
' ', $prefix .
$s . $postfix );
561 if ( isset( $frameParams[
'link-url'] ) && $frameParams[
'link-url'] !==
'' ) {
562 $mtoParams[
'custom-url-link'] = $frameParams[
'link-url'];
563 if ( isset( $frameParams[
'link-target'] ) ) {
564 $mtoParams[
'custom-target-link'] = $frameParams[
'link-target'];
567 $extLinkAttrs =
$parser->getExternalLinkAttribs( $frameParams[
'link-url'] );
568 foreach ( $extLinkAttrs
as $name => $val ) {
570 $mtoParams[
'parser-extlink-' .
$name] = $val;
573 } elseif ( isset( $frameParams[
'link-title'] ) && $frameParams[
'link-title'] !==
'' ) {
574 $mtoParams[
'custom-title-link'] = Title::newFromLinkTarget(
575 self::normaliseSpecialPage( $frameParams[
'link-title'] )
577 } elseif ( !empty( $frameParams[
'no-link'] ) ) {
580 $mtoParams[
'desc-link'] =
true;
581 $mtoParams[
'desc-query'] =
$query;
599 $align =
'right',
$params = [], $framed =
false, $manualthumb =
""
607 $frameParams[
'framed'] =
true;
609 if ( $manualthumb ) {
610 $frameParams[
'manualthumb'] = $manualthumb;
627 $exists = $file && $file->exists();
630 if ( !isset( $frameParams[
'align'] ) ) {
631 $frameParams[
'align'] =
'right';
633 if ( !isset( $frameParams[
'alt'] ) ) {
634 $frameParams[
'alt'] =
'';
636 if ( !isset( $frameParams[
'title'] ) ) {
637 $frameParams[
'title'] =
'';
639 if ( !isset( $frameParams[
'caption'] ) ) {
640 $frameParams[
'caption'] =
'';
645 $handlerParams[
'width'] = isset( $frameParams[
'upright'] ) ? 130 : 180;
649 $manualthumb =
false;
654 if ( isset( $frameParams[
'manualthumb'] ) ) {
655 # Use manually specified thumbnail
656 $manual_title = Title::makeTitleSafe(
NS_FILE, $frameParams[
'manualthumb'] );
657 if ( $manual_title ) {
666 } elseif ( isset( $frameParams[
'framed'] ) ) {
671 # Do not present an image bigger than the source, for bitmap-style images
672 # This is a hack to maintain compatibility with arbitrary pre-1.10 behavior
673 $srcWidth = $file->getWidth(
$page );
674 if ( $srcWidth && !$file->mustRender() &&
$handlerParams[
'width'] > $srcWidth ) {
681 $outerWidth = $thumb->getWidth() + 2;
687 # ThumbnailImage::toHtml() already adds page= onto the end of DjVu URLs
688 # So we don't need to pass it here in $query. However, the URL for the
689 # zoom icon still needs it, so we make a unique query for it. See bug 14771
695 && !isset( $frameParams[
'link-title'] )
696 && !isset( $frameParams[
'link-url'] )
697 && !isset( $frameParams[
'no-link'] ) ) {
698 $frameParams[
'link-url'] = $url;
701 $s =
"<div class=\"thumb t{$frameParams['align']}\">"
702 .
"<div class=\"thumbinner\" style=\"width:{$outerWidth}px;\">";
707 } elseif ( !$thumb ) {
708 $s .=
wfMessage(
'thumbnail_error',
'' )->escaped();
711 if ( !$noscale && !$manualthumb ) {
715 'alt' => $frameParams[
'alt'],
716 'title' => $frameParams[
'title'],
717 'img-class' => ( isset( $frameParams[
'class'] ) && $frameParams[
'class'] !==
''
718 ? $frameParams[
'class'] .
' '
719 :
'' ) .
'thumbimage'
723 if ( isset( $frameParams[
'framed'] ) ) {
726 $zoomIcon = Html::rawElement(
'div', [
'class' =>
'magnify' ],
727 Html::rawElement(
'a', [
729 'class' =>
'internal',
734 $s .=
' <div class="thumbcaption">' . $zoomIcon . $frameParams[
'caption'] .
"</div></div></div>";
735 return str_replace(
"\n",
' ',
$s );
750 $hp15[
'width'] = round( $hp[
'width'] * 1.5 );
752 $hp20[
'width'] = $hp[
'width'] * 2;
753 if ( isset( $hp[
'height'] ) ) {
754 $hp15[
'height'] = round( $hp[
'height'] * 1.5 );
755 $hp20[
'height'] = $hp[
'height'] * 2;
758 $thumb15 = $file->transform( $hp15 );
759 $thumb20 = $file->transform( $hp20 );
760 if ( $thumb15 && !$thumb15->isError() && $thumb15->getUrl() !== $thumb->getUrl() ) {
761 $thumb->responsiveUrls[
'1.5'] = $thumb15->getUrl();
763 if ( $thumb20 && !$thumb20->isError() && $thumb20->getUrl() !== $thumb->getUrl() ) {
764 $thumb->responsiveUrls[
'2'] = $thumb20->getUrl();
782 $query =
'', $unused1 =
'', $unused2 =
'',
$time =
false
785 wfWarn( __METHOD__ .
': Requires $title to be a Title object.' );
786 return "<!-- ERROR -->" . htmlspecialchars( $label );
790 if ( $label ==
'' ) {
791 $label =
$title->getPrefixedText();
793 $encLabel = htmlspecialchars( $label );
807 [
'class' =>
'mw-redirect' ],
809 [
'known',
'noclasses' ]
815 return '<a href="' . htmlspecialchars( $href ) .
'" class="new" title="' .
816 htmlspecialchars(
$title->getPrefixedText(), ENT_QUOTES ) .
'">' .
833 $q =
'wpDestFile=' . $destFile->getPartialURL();
844 return $upload->getLocalURL( $q );
875 if ( $file && $file->exists() ) {
876 $url = $file->getUrl();
895 if ( !Hooks::run(
'LinkerMakeMediaLinkFile',
897 wfDebug(
"Hook LinkerMakeMediaLinkFile changed the output of link "
898 .
"with url {$url} and text {$html} to {$ret}\n",
true );
917 $key = strtolower(
$name );
935 $linktype =
'',
$attribs = [], $title =
null
940 $class .=
" $linktype";
943 $class .=
" {$attribs['class']}";
948 $text = htmlspecialchars( $text );
954 $newRel = Parser::getExternalLinkRel( $url,
$title );
957 } elseif ( $newRel !==
'' ) {
959 $newRels = explode(
' ', $newRel );
960 $oldRels = explode(
' ',
$attribs[
'rel'] );
961 $combined = array_unique( array_merge( $newRels, $oldRels ) );
962 $attribs[
'rel'] = implode(
' ', $combined );
965 $success = Hooks::run(
'LinkerMakeExternalLink',
968 wfDebug(
"Hook LinkerMakeExternalLink changed the output of link "
969 .
"with url {$url} and text {$text} to {$link}\n",
true );
973 return Html::rawElement(
'a',
$attribs, $text );
984 public static function userLink( $userId, $userName, $altUserName =
false ) {
985 $classes =
'mw-userlink';
986 if ( $userId == 0 ) {
988 if ( $altUserName ===
false ) {
991 $classes .=
' mw-anonuserlink';
999 '<bdi>' . htmlspecialchars( $altUserName !==
false ? $altUserName : $userName ) .
'</bdi>',
1000 [
'class' => $classes ]
1018 $userId, $userText, $redContribsWhenNoEdits =
false,
$flags = 0, $edits =
null
1023 $addEmailLink =
$flags & self::TOOL_LINKS_EMAIL && $userId;
1032 if ( $redContribsWhenNoEdits ) {
1033 if ( intval( $edits ) === 0 && $edits !== 0 ) {
1034 $user = User::newFromId( $userId );
1035 $edits =
$user->getEditCount();
1037 if ( $edits === 0 ) {
1045 if ( $blockable &&
$wgUser->isAllowed(
'block' ) ) {
1049 if ( $addEmailLink &&
$wgUser->canSendEmail() ) {
1053 Hooks::run(
'UserToolLinksEdit', [ $userId, $userText, &$items ] );
1056 return wfMessage(
'word-separator' )->escaped()
1057 .
'<span class="mw-usertoollinks">'
1058 .
wfMessage(
'parentheses' )->rawParams(
$wgLang->pipeList( $items ) )->escaped()
1084 $userTalkPage = Title::makeTitle(
NS_USER_TALK, $userText );
1086 return $userTalkLink;
1129 return '<span class="history-deleted">' .
$link .
'</span>';
1153 return ' <span class="history-deleted">' .
$link .
'</span>';
1181 $comment, $title =
null, $local =
false, $wikiId =
null
1183 # Sanitize text a bit:
1185 # Allow HTML entities (for bug 13815)
1188 # Render autocomments and make links:
1213 $comment, $title =
null, $local =
false, $wikiId =
null
1227 '!(?:(?<=(.)))?/\*\s*(.*?)\s*\*/(?:(?=(.)))?!',
1228 function ( $match )
use (
$title, $local, $wikiId, &$append ) {
1232 $match += [
'',
'',
'',
'' ];
1234 $pre = $match[1] !==
'';
1236 $post = $match[3] !==
'';
1240 'FormatAutocomments',
1248 # Remove links that a user may have manually put in the autosummary
1249 # This could be improved by copying as much of Parser::stripSectionName as desired.
1254 $section = Sanitizer::normalizeSectionNameWhitespace(
$section ); # bug 22784
1256 $sectionTitle = Title::newFromText(
'#' .
$section );
1258 $sectionTitle = Title::makeTitleSafe(
$title->getNamespace(),
1261 if ( $sectionTitle ) {
1268 # written summary $presep autocomment (summary )
1269 $pre =
wfMessage(
'autocomment-prefix' )->inContentLanguage()->escaped();
1272 # autocomment $postsep written summary ( summary)
1273 $auto .=
wfMessage(
'colon-separator' )->inContentLanguage()->escaped();
1275 $auto =
'<span class="autocomment">' .
$auto .
'</span>';
1277 .
'<span dir="auto">' .
$auto;
1278 $append .=
'</span>';
1306 $comment, $title =
null, $local =
false, $wikiId =
null
1308 return preg_replace_callback(
1311 :? # ignore optional leading colon
1312 ([^\]|]+) # 1. link target; page names cannot include ] or |
1315 # Stop matching at ]] without relying on backtracking.
1319 ([^[]*) # 3. link trail (the text up until the next link)
1321 function ( $match )
use (
$title, $local, $wikiId ) {
1324 $medians =
'(?:' . preg_quote( MWNamespace::getCanonicalName(
NS_MEDIA ),
'/' ) .
'|';
1329 # fix up urlencoded title texts (copied from Parser::replaceInternalLinks)
1330 if ( strpos( $match[1],
'%' ) !==
false ) {
1332 rawurldecode( $match[1] ),
1333 [
'<' =>
'<',
'>' =>
'>' ]
1337 # Handle link renaming [[foo|text]] will show link as "text"
1338 if ( $match[2] !=
"" ) {
1345 if ( preg_match(
'/^' . $medians .
'(.*)$/i', $match[1], $submatch ) ) {
1346 # Media link; trail not supported.
1347 $linkRegexp =
'/\[\[(.*?)\]\]/';
1353 # Other kind of link
1354 # Make sure its target is non-empty
1355 if ( isset( $match[1][0] ) && $match[1][0] ==
':' ) {
1356 $match[1] = substr( $match[1], 1 );
1358 if ( $match[1] !==
false && $match[1] !==
'' ) {
1359 if ( preg_match(
$wgContLang->linkTrail(), $match[3], $submatch ) ) {
1360 $trail = $submatch[1];
1364 $linkRegexp =
'/\[\[(.*?)\]\]' . preg_quote( $trail,
'/' ) .
'/';
1370 $target = Title::newFromText( $linkTarget );
1372 if ( $target->getText() ==
'' && !$target->isExternal()
1375 $newTarget = clone
$title;
1376 $newTarget->setFragment(
'#' . $target->getFragment() );
1377 $target = $newTarget;
1416 if ( $wikiId !==
null && !
$title->isExternal() ) {
1420 $title->getPrefixedText(),
1442 # :Foobar -- override special treatment of prefix (images, language links)
1443 # /Foobar -- convert to CurrentPage/Foobar
1444 # /Foobar/ -- convert to CurrentPage/Foobar, strip the initial and final / from text
1445 # ../ -- convert to CurrentPage, from CurrentPage/CurrentSubPage
1446 # ../Foobar -- convert to CurrentPage/Foobar,
1447 # (from CurrentPage/CurrentSubPage)
1448 # ../Foobar/ -- convert to CurrentPage/Foobar, use 'Foobar' as text
1449 # (from CurrentPage/CurrentSubPage)
1453 # Some namespaces don't allow subpages,
1454 # so only perform processing if subpages are allowed
1455 if ( $contextTitle && MWNamespace::hasSubpages( $contextTitle->getNamespace() ) ) {
1456 $hash = strpos( $target,
'#' );
1457 if ( $hash !==
false ) {
1458 $suffix = substr( $target, $hash );
1459 $target = substr( $target, 0, $hash );
1464 $target = trim( $target );
1465 # Look at the first character
1466 if ( $target !=
'' && $target[0] ===
'/' ) {
1467 # / at end means we don't want the slash to be shown
1469 $trailingSlashes = preg_match_all(
'%(/+)$%', $target, $m );
1470 if ( $trailingSlashes ) {
1471 $noslash = $target = substr( $target, 1, -strlen( $m[0][0] ) );
1473 $noslash = substr( $target, 1 );
1476 $ret = $contextTitle->getPrefixedText() .
'/' . trim( $noslash ) . $suffix;
1477 if ( $text ===
'' ) {
1478 $text = $target . $suffix;
1479 } #
this might be changed
for ugliness
reasons
1481 # check for .. subpage backlinks
1483 $nodotdot = $target;
1484 while ( strncmp( $nodotdot,
"../", 3 ) == 0 ) {
1486 $nodotdot = substr( $nodotdot, 3 );
1488 if ( $dotdotcount > 0 ) {
1489 $exploded = explode(
'/', $contextTitle->getPrefixedText() );
1490 if ( count( $exploded ) > $dotdotcount ) { #
not allowed to go
below top level
page
1491 $ret = implode(
'/', array_slice( $exploded, 0, -$dotdotcount ) );
1492 # / at the end means don't show full path
1493 if ( substr( $nodotdot, -1, 1 ) ===
'/' ) {
1494 $nodotdot = rtrim( $nodotdot,
'/' );
1495 if ( $text ===
'' ) {
1496 $text = $nodotdot . $suffix;
1499 $nodotdot = trim( $nodotdot );
1500 if ( $nodotdot !=
'' ) {
1501 $ret .=
'/' . $nodotdot;
1526 $comment, $title =
null, $local =
false, $wikiId =
null
1535 $formatted =
wfMessage(
'parentheses' )->rawParams( $formatted )->escaped();
1536 return " <span class=\"comment\">$formatted</span>";
1555 $block =
" <span class=\"comment\">" .
wfMessage(
'rev-deleted-comment' )->escaped() .
"</span>";
1558 $rev->getTitle(), $local );
1560 $block =
" <span class=\"comment\">" .
wfMessage(
'rev-deleted-comment' )->escaped() .
"</span>";
1563 return " <span class=\"history-deleted\">$block</span>";
1575 $stxt =
wfMessage(
'historyempty' )->escaped();
1577 $stxt =
wfMessage(
'nbytes' )->numParams( $size )->escaped();
1578 $stxt =
wfMessage(
'parentheses' )->rawParams( $stxt )->escaped();
1580 return "<span class=\"history-size\">$stxt</span>";
1601 return "</li>\n" . str_repeat(
"</ul>\n</li>\n", $level > 0 ? $level : 0 );
1615 public static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex =
false ) {
1616 $classes =
"toclevel-$level";
1617 if ( $sectionIndex !==
false ) {
1618 $classes .=
" tocsection-$sectionIndex";
1620 return "\n<li class=\"$classes\"><a href=\"#" .
1621 $anchor .
'"><span class="tocnumber">' .
1622 $tocnumber .
'</span> <span class="toctext">' .
1623 $tocline .
'</span></a>';
1649 return '<div id="toc" class="toc">'
1650 .
'<div id="toctitle"><h2>' .
$title .
"</h2></div>\n"
1652 .
"</ul>\n</div>\n";
1667 if (
$section[
'toclevel'] > $lastLevel ) {
1669 } elseif (
$section[
'toclevel'] < $lastLevel ) {
1671 $lastLevel -
$section[
'toclevel'] );
1702 $link, $fallbackAnchor =
false
1704 $anchorEscaped = htmlspecialchars( $anchor );
1705 $ret =
"<h$level$attribs"
1706 .
"<span class=\"mw-headline\" id=\"$anchorEscaped\">$html</span>"
1709 if ( $fallbackAnchor !==
false && $fallbackAnchor !== $anchor ) {
1710 $fallbackAnchor = htmlspecialchars( $fallbackAnchor );
1711 $ret =
"<div id=\"$fallbackAnchor\"></div>$ret";
1726 if ( $trail !==
'' ) {
1728 if ( preg_match( $regex, $trail, $m ) ) {
1733 return [ $inside, $trail ];
1771 if ( in_array(
'verify',
$options,
true ) ) {
1773 if ( $editCount ===
false ) {
1780 if ( !in_array(
'noBrackets',
$options,
true ) ) {
1781 $inner =
$context->msg(
'brackets' )->rawParams( $inner )->escaped();
1784 return '<span class="mw-rollback-link">' . $inner .
'</span>';
1814 [
'rev_user_text',
'rev_deleted' ],
1816 [
'rev_page' =>
$rev->getTitle()->getArticleID() ],
1819 'USE INDEX' => [
'revision' =>
'page_timestamp' ],
1820 'ORDER BY' =>
'rev_timestamp DESC',
1827 foreach (
$res as $row ) {
1868 $disableRollbackEditCountSpecialPage = [
'Recentchanges',
'Watchlist' ];
1876 'action' =>
'rollback',
1877 'from' =>
$rev->getUserText(),
1878 'token' =>
$context->getUser()->getEditToken(
'rollback' ),
1881 'data-mw' =>
'interface',
1882 'title' =>
$context->msg(
'tooltip-rollback' )->text(),
1884 $options = [
'known',
'noclasses' ];
1886 if (
$context->getRequest()->getBool(
'bot' ) ) {
1888 $query[
'hidediff'] =
'1';
1891 $disableRollbackEditCount =
false;
1893 foreach ( $disableRollbackEditCountSpecialPage
as $specialPage ) {
1894 if (
$context->getTitle()->isSpecial( $specialPage ) ) {
1895 $disableRollbackEditCount =
true;
1901 if ( !$disableRollbackEditCount
1905 if ( !is_numeric( $editCount ) ) {
1913 $html =
$context->msg(
'rollbacklinkcount' )->numParams( $editCount )->parse();
1953 if ( $more instanceof
Message ) {
1954 $more = $more->toString();
1959 MediaWikiServices::getInstance()->getLinkRenderer()
1961 return $formatter->format( $templates,
$type, $more );
1975 if ( count( $hiddencats ) > 0 ) {
1976 # Construct the HTML
1977 $outText =
'<div class="mw-hiddenCategoriesExplanation">';
1978 $outText .=
wfMessage(
'hiddencategories' )->numParams( count( $hiddencats ) )->parseAsBlock();
1979 $outText .=
"</div><ul>\n";
1981 foreach ( $hiddencats
as $titleObj ) {
1982 # If it's hidden, it must exist - no need to check with a LinkBatch
1984 .
self::link( $titleObj,
null, [], [],
'known' )
1987 $outText .=
'</ul>';
2006 return htmlspecialchars(
$wgLang->formatSize( $size ) );
2025 $message =
wfMessage(
"tooltip-$name", $msgParams );
2026 if ( !$message->exists() ) {
2029 $tooltip = $message->text();
2030 # Compatibility: formerly some tooltips had [alt-.] hardcoded
2031 $tooltip = preg_replace(
"/ ?\[alt-.\]$/",
'', $tooltip );
2032 # Message equal to '-' means suppress it.
2033 if ( $tooltip ==
'-' ) {
2040 if ( $accesskey !==
false ) {
2042 if ( $tooltip ===
false || $tooltip ===
'' ) {
2043 $tooltip =
wfMessage(
'brackets', $accesskey )->text();
2045 $tooltip .=
wfMessage(
'word-separator' )->text();
2046 $tooltip .=
wfMessage(
'brackets', $accesskey )->text();
2068 if ( isset( self::$accesskeycache[
$name] ) ) {
2069 return self::$accesskeycache[
$name];
2072 $message =
wfMessage(
"accesskey-$name" );
2074 if ( !$message->exists() ) {
2077 $accesskey = $message->plain();
2078 if ( $accesskey ===
'' || $accesskey ===
'-' ) {
2079 # @todo FIXME: Per standard MW behavior, a value of '-' means to suppress the
2080 # attribute, but this is broken for accesskey: that might be a useful
2086 self::$accesskeycache[
$name] = $accesskey;
2087 return self::$accesskeycache[
$name];
2104 $canHide =
$user->isAllowed(
'deleterevision' );
2105 if ( !$canHide && !(
$rev->getVisibility() &&
$user->isAllowed(
'deletedhistory' ) ) ) {
2112 if (
$rev->getId() ) {
2116 'type' =>
'revision',
2117 'target' =>
$title->getPrefixedDBkey(),
2118 'ids' =>
$rev->getId()
2124 'type' =>
'archive',
2125 'target' =>
$title->getPrefixedDBkey(),
2126 'ids' =>
$rev->getTimestamp()
2146 $msgKey = $delete ?
'rev-delundel' :
'rev-showdeleted';
2148 $tag = $restricted ?
'strong' :
'span';
2152 [
'class' =>
'mw-revdelundel-link' ],
2167 $msgKey = $delete ?
'rev-delundel' :
'rev-showdeleted';
2169 $htmlParentheses =
wfMessage(
'parentheses' )->rawParams(
$html )->escaped();
2170 return Xml::tags(
'span', [
'class' =>
'mw-revdelundel-link' ], $htmlParentheses );
2185 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
2186 # no attribute" instead of "output '' as value for attribute", this
2187 # would be three lines.
2192 if (
$attribs[
'title'] ===
false ) {
2195 if (
$attribs[
'accesskey'] ===
false ) {
2209 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
2210 # no attribute" instead of "output '' as value for attribute", this
2211 # would be two lines.
2213 if ( $tooltip ===
false ) {
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgThumbUpright
Adjust width of upright images when parameter 'upright' is used This allows a nicer look for upright ...
$wgThumbLimits
Adjust thumbnails on image pages according to a user setting.
$wgDisableAnonTalk
Disable links to talk pages of anonymous users (IPs) in listings on special pages like page history,...
$wgSVGMaxSize
Don't scale a SVG larger than this.
$wgShowRollbackEditCount
The $wgShowRollbackEditCount variable is used to show how many edits can be rolled back.
$wgUploadMissingFileUrl
Point the upload link for missing files to an external URL, as with $wgUploadNavigationUrl.
$wgUploadNavigationUrl
Point the upload navigation link to an external URL Useful if you want to use a shared repository by ...
$wgResponsiveImages
Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
$wgEnableUploads
Uploads have to be specially set up to be secure.
$wgMiserMode
Disable database-intensive features.
wfGetLangObj( $langcode=false)
Return a Language object from $langcode.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfFindFile( $title, $options=[])
Find a file.
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
wfCgiToArray( $query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
if(! $wgRequest->checkUrlExtension()) if(isset($_SERVER[ 'PATH_INFO']) &&$_SERVER[ 'PATH_INFO'] !='') if(! $wgEnableAPI) $wgTitle
msg()
Get a Message object with context set Parameters are the same as wfMessage()
Marks HTML that shouldn't be escaped.
static prettifyIP( $ip)
Prettify an IP for display to end users.
Some internal bits split of from Skin.php.
static tocList( $toc, $lang=false)
Wraps the TOC in a table and provides the hide/collapse javascript.
static generateRollback( $rev, IContextSource $context=null, $options=[ 'verify'])
Generate a rollback link for a given revision.
static getInternalLinkAttributesObj( $nt, $unused=null, $class='', $title=false)
Get the appropriate HTML attributes to add to the "a" element of an internal link,...
static getLinkAttributesInternal( $title, $class)
Common code for getLinkAttributesX functions.
static makeMediaLinkFile(Title $title, $file, $html='')
Create a direct link to a given uploaded file.
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
static fnamePart( $url)
Returns the filename part of an url.
static tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex=false)
parameter level defines if we are on an indentation level
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
static makeThumbLink2(Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="")
static formatSize( $size)
static accesskey( $name)
Given the id of an interface element, constructs the appropriate accesskey attribute from the system ...
static getInterwikiLinkAttributes( $title, $unused=null, $class='external')
Get the appropriate HTML attributes to add to the "a" element of an interwiki link.
static formatAutocomments( $comment, $title=null, $local=false, $wikiId=null)
Converts autogenerated comments in edit summaries into section links.
static specialLink( $name, $key='')
Make a link to a special page given its name and, optionally, a message key from the link text.
static getLinkColour(LinkTarget $t, $threshold)
Return the CSS colour of a known link.
static makeImageLink(Parser $parser, Title $title, $file, $frameParams=[], $handlerParams=[], $time=false, $query="", $widthOption=null)
Given parameters derived from [[Image:Foo|options...]], generate the HTML that that syntax inserts in...
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static generateTOC( $tree, $lang=false)
Generate a table of contents from a section tree.
static makeExternalImage( $url, $alt='')
Return the code for images which were added via external links, via Parser::maybeMakeExternalImage().
static userToolLinksRedContribs( $userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
static buildRollbackLink( $rev, IContextSource $context=null, $editCount=false)
Build a raw rollback link, useful for collections of "tool" links.
static processResponsiveImages( $file, $thumb, $hp)
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable.
static blockLink( $userId, $userText)
static revDeleteLinkDisabled( $delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
static getRollbackEditCount( $rev, $verify)
This function will return the number of revisions which a rollback would revert and,...
static normalizeSubpageLink( $contextTitle, $target, &$text)
static revComment(Revision $rev, $local=false, $isPublic=false)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
const TOOL_LINKS_NOBLOCK
Flags for userToolLinks()
static makeSelfLinkObj( $nt, $html='', $query='', $trail='', $prefix='')
Make appropriate markup for a link to the current article.
static getUploadUrl( $destFile, $query='')
Get the URL to upload a certain file.
static tocIndent()
Add another level to the Table of Contents.
static revUserLink( $rev, $isPublic=false)
Generate a user link if the current user is allowed to view it.
static commentBlock( $comment, $title=null, $local=false, $wikiId=null)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
static revUserTools( $rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
static emailLink( $userId, $userText)
static makeThumbLinkObj(Title $title, $file, $label='', $alt, $align='right', $params=[], $framed=false, $manualthumb="")
Make HTML for a thumbnail including image, border and caption.
static formatHiddenCategories( $hiddencats)
Returns HTML for the "hidden categories on this page" list.
static splitTrail( $trail)
Split a link trail, return the "inside" portion and the remainder of the trail as a two-element array...
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
static formatRevisionSize( $size)
static getInternalLinkAttributes( $title, $unused=null, $class='')
Get the appropriate HTML attributes to add to the "a" element of an internal link.
static tooltip( $name, $options=null)
Returns raw bits of HTML, use titleAttrib()
static userTalkLink( $userId, $userText)
static formatLinksInComment( $comment, $title=null, $local=false, $wikiId=null)
Formats wiki links and media links in text; all other wiki formatting is ignored.
static makeMediaLinkObj( $title, $html='', $time=false)
Create a direct link to a given uploaded file.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
static makeCommentLink(Title $title, $text, $wikiId=null, $options=[])
Generates a link to the given Title.
static normaliseSpecialPage(LinkTarget $target)
static makeHeadline( $level, $attribs, $anchor, $html, $link, $fallbackAnchor=false)
Create a headline for content.
static formatTemplates( $templates, $preview=false, $section=false, $more=null)
static tocUnindent( $level)
Finish one or more sublevels on the Table of Contents.
static getImageLinkMTOParams( $frameParams, $query='', $parser=null)
Get the link parameters for MediaTransformOutput::toHtml() from given frame parameters supplied by th...
static revDeleteLink( $query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
static tocLineEnd()
End a Table Of Contents line.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
static makeBrokenImageLinkObj( $title, $label='', $query='', $unused1='', $unused2='', $time=false)
Make a "broken" link to an image.
static getRevDeleteLink(User $user, Revision $rev, Title $title)
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the setti...
The Message class provides methods which fulfil two basic services:
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
static singleton()
Get a RepoGroup instance.
static getMain()
Static methods.
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
static getTitleValueFor( $name, $subpage=false, $fragment='')
Get a localised TitleValue object for a specified special page name.
static escapeRegexReplacement( $string)
Escape a string to make it suitable for inclusion in a preg_replace() replacement parameter.
Handles formatting for the "templates used on this page" lists.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static getForeignURL( $wikiID, $page, $fragmentId=null)
Convenience to get a url to a page on a foreign wiki.
static expandAttributes( $attribs)
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : att...
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like please read the documentation for except in special pages derived from QueryPage It s a common pitfall for new developers to submit code containing SQL queries which examine huge numbers of rows Remember that COUNT * is(N), counting rows in atable is like counting beans in a bucket.------------------------------------------------------------------------ Replication------------------------------------------------------------------------The largest installation of MediaWiki, Wikimedia, uses a large set ofslave MySQL servers replicating writes made to a master MySQL server. Itis important to understand the issues associated with this setup if youwant to write code destined for Wikipedia.It 's often the case that the best algorithm to use for a given taskdepends on whether or not replication is in use. Due to our unabashedWikipedia-centrism, we often just use the replication-friendly version, but if you like, you can use wfGetLB() ->getServerCount() > 1 tocheck to see if replication is in use.===Lag===Lag primarily occurs when large write queries are sent to the master.Writes on the master are executed in parallel, but they are executed inserial when they are replicated to the slaves. The master writes thequery to the binlog when the transaction is committed. The slaves pollthe binlog and start executing the query as soon as it appears. They canservice reads while they are performing a write query, but will not readanything more from the binlog and thus will perform no more writes. Thismeans that if the write query runs for a long time, the slaves will lagbehind the master for the time it takes for the write query to complete.Lag can be exacerbated by high read load. MediaWiki 's load balancer willstop sending reads to a slave when it is lagged by more than 30 seconds.If the load ratios are set incorrectly, or if there is too much loadgenerally, this may lead to a slave permanently hovering around 30seconds lag.If all slaves are lagged by more than 30 seconds, MediaWiki will stopwriting to the database. All edits and other write operations will berefused, with an error returned to the user. This gives the slaves achance to catch up. Before we had this mechanism, the slaves wouldregularly lag by several minutes, making review of recent editsdifficult.In addition to this, MediaWiki attempts to ensure that the user seesevents occurring on the wiki in chronological order. A few seconds of lagcan be tolerated, as long as the user sees a consistent picture fromsubsequent requests. This is done by saving the master binlog positionin the session, and then at the start of each request, waiting for theslave to catch up to that position before doing any reads from it. Ifthis wait times out, reads are allowed anyway, but the request isconsidered to be in "lagged slave mode". Lagged slave mode can bechecked by calling wfGetLB() ->getLaggedSlaveMode(). The onlypractical consequence at present is a warning displayed in the pagefooter.===Lag avoidance===To avoid excessive lag, queries which write large numbers of rows shouldbe split up, generally to write one row at a time. Multi-row INSERT ...SELECT queries are the worst offenders should be avoided altogether.Instead do the select first and then the insert.===Working with lag===Despite our best efforts, it 's not practical to guarantee a low-lagenvironment. Lag will usually be less than one second, but mayoccasionally be up to 30 seconds. For scalability, it 's very importantto keep load on the master low, so simply sending all your queries tothe master is not the answer. So when you have a genuine need forup-to-date data, the following approach is advised:1) Do a quick query to the master for a sequence number or timestamp 2) Run the full query on the slave and check if it matches the data you gotfrom the master 3) If it doesn 't, run the full query on the masterTo avoid swamping the master every time the slaves lag, use of thisapproach should be kept to a minimum. In most cases you should just readfrom the slave and let the user deal with the delay.------------------------------------------------------------------------ Lock contention------------------------------------------------------------------------Due to the high write rate on Wikipedia(and some other wikis), MediaWiki developers need to be very careful to structure their writesto avoid long-lasting locks. By default, MediaWiki opens a transactionat the first query, and commits it before the output is sent. Locks willbe held from the time when the query is done until the commit. So youcan reduce lock time by doing as much processing as possible before youdo your write queries.Often this approach is not good enough, and it becomes necessary toenclose small groups of queries in their own transaction. Use thefollowing syntax:$dbw=wfGetDB(DB_MASTER
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database etc For and for historical reasons
when a variable name is used in a it is silently declared as a new local masking the global
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
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
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 change
the array() calling protocol came about after MediaWiki 1.4rc1.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead $parser
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' 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
see documentation in includes Linker php for Linker::makeImageLink & $time
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped $pre
namespace and then decline to actually register it file or subcat img or subcat $title
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template to be included in the link
null means default & $customAttribs
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 unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped true if there is text before this autocomment $auto
it s the revision text itself In either if gzip is the revision text is gzipped $flags
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor' $rcid is used in generating this variable which contains information about the new such as the revision s whether the revision was marked as a minor edit or not
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
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
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
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 just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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 just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' 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 page
Allows to change the fields on the form that will be generated $name
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' 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 $page
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
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 just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
see documentation in includes Linker php for Linker::makeImageLink & $handlerParams
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
processing should stop and the error should be shown to the user * false
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
Interface for objects which can provide a MediaWiki context on request.
controlled by $wgMainCacheType controlled by $wgParserCacheType controlled by $wgMessageCacheType If you set CACHE_NONE to one of the three control default value for MediaWiki still create a but requests to it are no ops and we always fall through to the database If the cache daemon can t be it should also disable itself fairly smoothly By $wgMemc is used but when it is $parserMemc or $messageMemc this is mentioned below
if(!isset( $args[0])) $lang