25 use WrappedString\WrappedString;
26 use WrappedString\WrappedStringList;
257 'Accept-Encoding' => [
'match=gzip' ],
304 # Extensions should use `new RequestContext` instead of `new OutputPage` now.
317 public function redirect( $url, $responsecode =
'302' ) {
318 # Strip newlines as a paranoia check for header injection in PHP<5.1.2
319 $this->mRedirect = str_replace(
"\n",
'', $url );
320 $this->mRedirectCode = $responsecode;
341 $this->copyrightUrl = $url;
350 $this->mStatusCode = $statusCode;
361 array_push( $this->mMetatags, [
$name, $val ] );
382 array_push( $this->mLinktags, $linkarr );
413 $this->mCanonicalUrl = $url;
433 # note: buggy CC software only reads first "meta" link
434 static $haveMeta =
false;
436 return 'alternate meta';
451 $this->mScripts .= $script;
465 array_push( $this->mExtStyles, $url );
489 if ( substr( $file, 0, 1 ) ==
'/' || preg_match(
'#^[a-z]*://#i', $file ) ) {
492 $path = $this->
getConfig()->get(
'StylePath' ) .
"/common/{$file}";
522 $filteredModules = [];
523 foreach ( $modules
as $val ) {
527 && ( is_null( $position ) || $module->getPosition() == $position )
528 && ( !$this->mTarget || in_array( $this->mTarget, $module->getTargets() ) )
530 $filteredModules[] = $val;
533 return $filteredModules;
544 public function getModules( $filter =
false, $position = null, $param =
'mModules' ) {
545 $modules = array_values( array_unique( $this->$param ) );
559 $this->mModules = array_merge( $this->mModules, (
array)$modules );
571 return $this->
getModules( $filter, $position,
'mModuleScripts' );
582 $this->mModuleScripts = array_merge( $this->mModuleScripts, (
array)$modules );
594 return $this->
getModules( $filter, $position,
'mModuleStyles' );
607 $this->mModuleStyles = array_merge( $this->mModuleStyles, (
array)$modules );
623 $this->mTarget = $target;
658 return isset( $this->mHeadItems[
$name] );
676 $this->mArticleBodyOnly = $only;
707 if ( isset( $this->mProperties[
$name] ) ) {
708 return $this->mProperties[
$name];
727 wfDebug( __METHOD__ .
": CACHE DISABLED, NO TIMESTAMP\n" );
731 if ( !$config->get(
'CachePages' ) ) {
732 wfDebug( __METHOD__ .
": CACHE DISABLED\n" );
739 'user' => $this->
getUser()->getTouched(),
740 'epoch' => $config->get(
'CacheEpoch' )
742 if ( $config->get(
'UseSquid' ) ) {
744 $modifiedTimes[
'sepoch'] =
wfTimestamp(
TS_MW, time() - $config->get(
'SquidMaxage' ) );
746 Hooks::run(
'OutputPageCheckLastModified', [ &$modifiedTimes, $this ] );
748 $maxModified = max( $modifiedTimes );
751 $clientHeader = $this->
getRequest()->getHeader(
'If-Modified-Since' );
752 if ( $clientHeader ===
false ) {
753 wfDebug( __METHOD__ .
": client did not send If-Modified-Since header",
'private' );
757 # IE sends sizes after the date like this:
758 # Wed, 20 Aug 2003 06:51:19 GMT; length=5202
759 # this breaks strtotime().
760 $clientHeader = preg_replace(
'/;.*$/',
'', $clientHeader );
762 MediaWiki\suppressWarnings();
763 $clientHeaderTime = strtotime( $clientHeader );
764 MediaWiki\restoreWarnings();
765 if ( !$clientHeaderTime ) {
767 .
": unable to parse the client's If-Modified-Since header: $clientHeader\n" );
775 if ( $info !==
'' ) {
781 wfDebug( __METHOD__ .
": client sent If-Modified-Since: " .
783 wfDebug( __METHOD__ .
": effective Last-Modified: " .
785 if ( $clientHeaderTime < $maxModified ) {
786 wfDebug( __METHOD__ .
": STALE, $info",
'private' );
791 # Give a 304 Not Modified response code and disable body output
792 wfDebug( __METHOD__ .
": NOT MODIFIED, $info",
'private' );
793 ini_set(
'zlib.output_compression', 0 );
794 $this->
getRequest()->response()->statusHeader( 304 );
827 if ( isset( $policy[
'index'] ) ) {
830 if ( isset( $policy[
'follow'] ) ) {
843 $policy = trim( $policy );
844 if ( in_array( $policy, [
'index',
'noindex' ] ) ) {
845 $this->mIndexPolicy = $policy;
857 $policy = trim( $policy );
858 if ( in_array( $policy, [
'follow',
'nofollow' ] ) ) {
859 $this->mFollowPolicy = $policy;
870 $this->mPageTitleActionText = $text;
892 $this->mHTMLtitle =
$name;
911 $this->mRedirectedFrom =
$t;
929 # change "<script>foo&bar</script>" to "<script>foo&bar</script>"
930 # but leave "<i>foobar</i>" alone
932 $this->mPagetitle = $nameWithTags;
934 # change "<i>foo&bar</i>" to "foo&bar"
937 ->inContentLanguage()
975 if ( $str instanceof
Message ) {
976 $this->mSubtitle[] = $str->setContext( $this->
getContext() )->parse();
978 $this->mSubtitle[] = $str;
992 $query[
'redirect'] =
'no';
1012 $this->mSubtitle = [];
1021 return implode(
"<br />\n\t\t\t\t", $this->mSubtitle );
1029 $this->mPrintable =
true;
1045 $this->mDoNothing =
true;
1087 $this->mFeedLinks = [];
1101 $this->mFeedLinks = [];
1105 if ( is_string( $val ) ) {
1119 if ( in_array( $format, $this->
getConfig()->
get(
'AdvertisedFeedTypes' ) ) ) {
1120 $this->mFeedLinks[$format] = $href;
1129 return count( $this->mFeedLinks ) > 0;
1157 $this->mIsarticle = $v;
1159 $this->mIsArticleRelated = $v;
1180 $this->mIsArticleRelated = $v;
1182 $this->mIsarticle =
false;
1202 $this->mLanguageLinks += $newLinkArray;
1212 $this->mLanguageLinks = $newLinkArray;
1232 if ( !is_array( $categories ) || count( $categories ) == 0 ) {
1236 # Add the links to a LinkBatch
1241 # Fetch existence plus the hiddencat property
1243 $fields = array_merge(
1245 [
'page_namespace',
'page_title',
'pp_value' ]
1248 $res =
$dbr->select( [
'page',
'page_props' ],
1250 $lb->constructSet(
'page',
$dbr ),
1253 [
'page_props' => [
'LEFT JOIN', [
1254 'pp_propname' =>
'hiddencat',
1259 # Add the results to the link cache
1262 # Set all the values to 'normal'.
1263 $categories = array_fill_keys( array_keys( $categories ),
'normal' );
1265 # Mark hidden categories
1266 foreach (
$res as $row ) {
1267 if ( isset( $row->pp_value ) ) {
1268 $categories[$row->page_title] =
'hidden';
1272 # Add the remaining categories to the skin
1274 'OutputPageMakeCategoryLinks',
1275 [ &$this, $categories, &$this->mCategoryLinks ] )
1277 foreach ( $categories
as $category =>
$type ) {
1279 $category = (
string)$category;
1280 $origcategory = $category;
1285 $wgContLang->findVariantLink( $category,
$title,
true );
1286 if ( $category != $origcategory && array_key_exists( $category, $categories ) ) {
1289 $text = $wgContLang->convertHtml(
$title->getText() );
1290 $this->mCategories[] =
$title->getText();
1302 $this->mCategoryLinks = [];
1339 ksort( $this->mIndicators );
1364 $text = $this->
msg(
'helppage-top-gethelp' )->escaped();
1366 if ( $overrideBaseUrl ) {
1369 $toUrlencoded =
wfUrlencode( str_replace(
' ',
'_', $to ) );
1370 $helpUrl =
"//www.mediawiki.org/wiki/Special:MyLanguage/$toUrlencoded";
1377 'target' =>
'_blank',
1378 'class' =>
'mw-helplink',
1402 if ( $this->
getConfig()->
get(
'AllowSiteCSSOnRestrictedPages' ) ) {
1421 return min( array_values( $this->mAllowedModules ) );
1423 return isset( $this->mAllowedModules[
$type] )
1424 ? $this->mAllowedModules[
$type]
1457 $this->mBodytext .= $text;
1477 $this->mBodytext =
'';
1501 $anonPO->setEditSection(
false );
1502 if ( !
$options->matches( $anonPO ) ) {
1508 if ( !$this->mParserOptions ) {
1514 $po->setEditSection(
false );
1515 $po->isBogus =
true;
1523 $this->mParserOptions->setEditSection(
false );
1529 return wfSetVar( $this->mParserOptions, null,
true );
1543 $val = is_null( $revid ) ? null : intval( $revid );
1544 return wfSetVar( $this->mRevisionId, $val );
1585 if ( $file instanceof
File && $file->
exists() ) {
1586 $val = [
'time' => $file->getTimestamp(),
'sha1' => $file->getSha1() ];
1588 return wfSetVar( $this->mFileVersion, $val,
true );
1629 public function addWikiText( $text, $linestart =
true, $interface =
true ) {
1681 $tidy =
false, $interface =
false
1686 $oldTidy = $popts->setTidy( $tidy );
1687 $popts->setInterfaceMessage( (
bool)$interface );
1690 $text, $title, $popts,
1691 $linestart,
true, $this->mRevisionId
1694 $popts->setTidy( $oldTidy );
1724 $this->mHideNewSectionLink =
$parserOutput->getHideNewSection();
1730 $this->mHeadItems = array_merge( $this->mHeadItems,
$parserOutput->getHeadItems() );
1735 $this->mPreventClickjacking = $this->mPreventClickjacking
1740 if ( isset( $this->mTemplateIds[$ns] ) ) {
1741 $this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
1743 $this->mTemplateIds[$ns] = $dbks;
1748 $this->mImageTimeKeys[$dbk] = $data;
1752 $parserOutputHooks = $this->
getConfig()->get(
'ParserOutputHooks' );
1754 list( $hookName, $data ) = $hookInfo;
1755 if ( isset( $parserOutputHooks[$hookName] ) ) {
1756 call_user_func( $parserOutputHooks[$hookName], $this,
$parserOutput, $data );
1766 $this->limitReportData =
$parserOutput->getLimitReportData();
1771 Hooks::run(
'LanguageLinks', [ $this->
getTitle(), &$this->mLanguageLinks, &$linkFlags ] );
1800 Hooks::run(
'OutputPageBeforeHTML', [ &$this, &$text ] );
1815 $parserOutput->setEditSectionTokens( $this->mEnableSectionEditLinks );
1842 public function parse( $text, $linestart =
true, $interface =
false, $language = null ) {
1845 if ( is_null( $this->
getTitle() ) ) {
1846 throw new MWException(
'Empty $mTitle in ' . __METHOD__ );
1851 $popts->setInterfaceMessage(
true );
1853 if ( $language !== null ) {
1854 $oldLang = $popts->setTargetLanguage( $language );
1859 $linestart,
true, $this->mRevisionId
1863 $popts->setInterfaceMessage(
false );
1865 if ( $language !== null ) {
1866 $popts->setTargetLanguage( $oldLang );
1882 public function parseInline( $text, $linestart =
true, $interface =
false ) {
1883 $parsed = $this->
parse( $text, $linestart, $interface );
1901 $this->mCdnMaxage = min( $maxage, $this->mCdnMaxageLimit );
1911 $this->mCdnMaxageLimit = min( $maxage, $this->mCdnMaxageLimit );
1923 return wfSetVar( $this->mEnableClientCache, $state );
1933 if ( $cookies === null ) {
1935 $cookies = array_merge(
1936 SessionManager::singleton()->getVaryCookies(),
1940 $config->get(
'CacheVaryCookies' )
1942 Hooks::run(
'GetCacheVaryCookies', [ $this, &$cookies ] );
1956 if (
$request->getCookie( $cookieName,
'',
'' ) !==
'' ) {
1957 wfDebug( __METHOD__ .
": found $cookieName\n" );
1961 wfDebug( __METHOD__ .
": no cache-varying cookies found\n" );
1974 if ( !array_key_exists( $header, $this->mVaryHeader ) ) {
1975 $this->mVaryHeader[$header] = [];
1977 if ( !is_array( $option ) ) {
1980 $this->mVaryHeader[$header] = array_unique( array_merge( $this->mVaryHeader[$header], $option ) );
1995 foreach ( SessionManager::singleton()->getVaryHeaders()
as $header =>
$options ) {
1998 return 'Vary: ' . implode(
', ', array_keys( $this->mVaryHeader ) );
2009 $cookiesOption = [];
2010 foreach ( $cvCookies
as $cookieName ) {
2011 $cookiesOption[] =
'param=' . $cookieName;
2015 foreach ( SessionManager::singleton()->getVaryHeaders()
as $header =>
$options ) {
2020 foreach ( $this->mVaryHeader
as $header => $option ) {
2021 $newheader = $header;
2022 if ( is_array( $option ) && count( $option ) > 0 ) {
2023 $newheader .=
';' . implode(
';', $option );
2025 $headers[] = $newheader;
2027 $key =
'Key: ' . implode(
',', $headers );
2047 if ( !$this->
getRequest()->getCheck(
'variant' ) &&
$lang->hasVariants() ) {
2048 $variants =
$lang->getVariants();
2050 foreach ( $variants
as $variant ) {
2051 if ( $variant ===
$lang->getCode() ) {
2054 $aloption[] =
'substr=' . $variant;
2059 $variantBCP47 =
wfBCP47( $variant );
2060 if ( $variantBCP47 !== $variant ) {
2061 $aloption[] =
'substr=' . $variantBCP47;
2080 $this->mPreventClickjacking = $enable;
2089 $this->mPreventClickjacking =
false;
2111 if ( $config->get(
'BreakFrames' ) ) {
2113 } elseif ( $this->mPreventClickjacking && $config->get(
'EditPageFrameOptions' ) ) {
2114 return $config->get(
'EditPageFrameOptions' );
2129 # don't serve compressed data to clients who can't handle it
2130 # maintain different caches for logged-in users and non-logged in ones
2133 if ( $config->get(
'UseKeyHeader' ) ) {
2137 if ( $this->mEnableClientCache ) {
2139 $config->get(
'UseSquid' ) &&
2141 !SessionManager::getGlobalSession()->isPersistent() &&
2143 $this->mCdnMaxage != 0 &&
2146 if ( $config->get(
'UseESI' ) ) {
2147 # We'll purge the proxy cache explicitly, but require end user agents
2148 # to revalidate against the proxy on each visit.
2149 # Surrogate-Control controls our CDN, Cache-Control downstream caches
2150 wfDebug( __METHOD__ .
": proxy caching with ESI; {$this->mLastModified} **",
'private' );
2151 # start with a shorter timeout for initial testing
2152 # header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
2153 $response->header(
'Surrogate-Control: max-age=' . $config->get(
'SquidMaxage' )
2154 .
'+' . $this->mCdnMaxage .
', content="ESI/1.0"' );
2155 $response->header(
'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
2157 # We'll purge the proxy cache for anons explicitly, but require end user agents
2158 # to revalidate against the proxy on each visit.
2159 # IMPORTANT! The CDN needs to replace the Cache-Control header with
2160 # Cache-Control: s-maxage=0, must-revalidate, max-age=0
2161 wfDebug( __METHOD__ .
": local proxy caching; {$this->mLastModified} **",
'private' );
2162 # start with a shorter timeout for initial testing
2163 # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
2164 $response->header(
'Cache-Control: s-maxage=' . $this->mCdnMaxage
2165 .
', must-revalidate, max-age=0' );
2168 # We do want clients to cache if they can, but they *must* check for updates
2169 # on revisiting the page.
2170 wfDebug( __METHOD__ .
": private caching; {$this->mLastModified} **",
'private' );
2171 $response->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s', 0 ) .
' GMT' );
2172 $response->header(
"Cache-Control: private, must-revalidate, max-age=0" );
2174 if ( $this->mLastModified ) {
2175 $response->header(
"Last-Modified: {$this->mLastModified}" );
2178 wfDebug( __METHOD__ .
": no caching **",
'private' );
2180 # In general, the absence of a last modified header should be enough to prevent
2181 # the client from using its cache. We send a few other things just to make sure.
2182 $response->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s', 0 ) .
' GMT' );
2183 $response->header(
'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
2184 $response->header(
'Pragma: no-cache' );
2193 if ( $this->mDoNothing ) {
2200 if ( $this->mRedirect !=
'' ) {
2201 # Standards require redirect URLs to be absolute
2207 if (
Hooks::run(
"BeforePageRedirect", [ $this, &$redirect, &
$code ] ) ) {
2209 if ( !$config->get(
'DebugRedirects' ) ) {
2214 if ( $config->get(
'VaryOnXFP' ) ) {
2219 $response->header(
"Content-Type: text/html; charset=utf-8" );
2220 if ( $config->get(
'DebugRedirects' ) ) {
2221 $url = htmlspecialchars( $redirect );
2222 print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
2223 print "<p>Location: <a href=\"$url\">$url</a></p>\n";
2224 print "</body>\n</html>\n";
2226 $response->header(
'Location: ' . $redirect );
2231 } elseif ( $this->mStatusCode ) {
2232 $response->statusHeader( $this->mStatusCode );
2235 # Buffer output; final headers may depend on later processing
2238 $response->header(
'Content-type: ' . $config->get(
'MimeType' ) .
'; charset=UTF-8' );
2239 $response->header(
'Content-language: ' . $config->get(
'LanguageCode' ) );
2243 $response->header(
'X-UA-Compatible: IE=Edge' );
2247 if ( $frameOptions ) {
2248 $response->header(
"X-Frame-Options: $frameOptions" );
2251 if ( $this->mArticleBodyOnly ) {
2256 $modules = $sk->getDefaultModules();
2262 'mediawiki.page.startup',
2267 if ( $config->get(
'ResponsiveImages' ) ) {
2268 $coreModules[] =
'mediawiki.hidpi';
2272 foreach ( $modules
as $group ) {
2279 Hooks::run(
'BeforePageDisplay', [ &$this, &$sk ] );
2283 }
catch ( Exception
$e ) {
2291 Hooks::run(
'AfterFinalPageOutput', [ $this ] );
2292 }
catch ( Exception
$e ) {
2315 if ( $htmlTitle !==
false ) {
2321 $this->mRedirect =
'';
2345 if ( $msg instanceof Message ) {
2347 trigger_error(
'Argument ignored: $params. The message parameters argument '
2348 .
'is discarded when the $msg argument is a Message object instead of '
2349 .
'a string.', E_USER_NOTICE );
2351 $this->
addHTML( $msg->parseAsBlock() );
2371 if ( in_array( $action, [
'read',
'edit',
'createpage',
'createtalk',
'upload' ] )
2372 && $this->
getUser()->isAnon() && count( $errors ) == 1 && isset( $errors[0][0] )
2373 && ( $errors[0][0] ==
'badaccess-groups' || $errors[0][0] ==
'badaccess-group0' )
2377 $displayReturnto = null;
2379 # Due to bug 32276, if a user does not have read permissions,
2380 # $this->getTitle() will just give Special:Badtitle, which is
2381 # not especially useful as a returnto parameter. Use the title
2382 # from the request instead, if there was one.
2385 if ( $action ==
'edit' ) {
2386 $msg =
'whitelistedittext';
2387 $displayReturnto = $returnto;
2388 } elseif ( $action ==
'createpage' || $action ==
'createtalk' ) {
2389 $msg =
'nocreatetext';
2390 } elseif ( $action ==
'upload' ) {
2391 $msg =
'uploadnologintext';
2393 $msg =
'loginreqpagetext';
2400 $query[
'returnto'] = $returnto->getPrefixedText();
2403 $returntoquery =
$request->getValues();
2404 unset( $returntoquery[
'title'] );
2405 unset( $returntoquery[
'returnto'] );
2406 unset( $returntoquery[
'returntoquery'] );
2412 $this->
msg(
'loginreqlink' )->escaped(),
2418 $this->
addHTML( $this->
msg( $msg )->rawParams( $loginLink )->
parse() );
2420 # Don't return to a page the user can't read otherwise
2421 # we'll end up in a pointless loop
2422 if ( $displayReturnto && $displayReturnto->userCan(
'read', $this->getUser() ) ) {
2452 if ( $action == null ) {
2453 $text = $this->
msg(
'permissionserrorstext', count( $errors ) )->plain() .
"\n\n";
2455 $action_desc = $this->
msg(
"action-$action" )->plain();
2457 'permissionserrorstext-withaction',
2460 )->plain() .
"\n\n";
2463 if ( count( $errors ) > 1 ) {
2464 $text .=
'<ul class="permissions-errors">' .
"\n";
2466 foreach ( $errors
as $error ) {
2468 $text .= call_user_func_array( [ $this,
'msg' ], $error )->plain();
2473 $text .=
"<div class=\"permissions-errors\">\n" .
2474 call_user_func_array( [ $this,
'msg' ], reset( $errors ) )->plain() .
2493 if ( func_num_args() > 0 ) {
2494 throw new MWException( __METHOD__ .
' no longer accepts arguments since 1.25.' );
2522 if ( $lag >= $config->get(
'SlaveLagWarning' ) ) {
2523 $message = $lag < $config->get(
'SlaveLagCritical' )
2526 $wrap =
Html::rawElement(
'div', [
'class' =>
"mw-{$message}" ],
"\n$1\n" );
2566 $link = $this->
msg(
'returnto' )->rawParams(
2568 $this->
addHTML(
"<p id=\"mw-returnto\">{$link}</p>\n" );
2579 public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
2580 if ( $returnto == null ) {
2581 $returnto = $this->
getRequest()->getText(
'returnto' );
2584 if ( $returntoquery == null ) {
2585 $returntoquery = $this->
getRequest()->getText(
'returntoquery' );
2588 if ( $returnto ===
'' ) {
2592 if ( is_object( $returnto ) ) {
2593 $titleObj = $returnto;
2597 if ( !is_object( $titleObj ) ) {
2613 $sitedir = $wgContLang->getDir();
2624 $pieces[] = $openHead;
2636 $pieces[] =
Html::element(
'meta', [
'charset' =>
'UTF-8' ] );
2648 foreach ( $this->mHeadItems
as $item ) {
2654 $pieces[] = $closeHead;
2658 $bodyClasses[] =
'mediawiki';
2660 # Classes for LTR/RTL directionality support
2661 $bodyClasses[] = $userdir;
2662 $bodyClasses[] =
"sitedir-$sitedir";
2664 if ( $this->
getLanguage()->capitalizeAllNouns() ) {
2665 # A <body> class is probably not the best way to do this . . .
2666 $bodyClasses[] =
'capitalize-all-nouns';
2672 $bodyClasses[] =
'mw-hide-empty-elt';
2682 $bodyAttrs[
'class'] = implode(
' ', $bodyClasses );
2686 Hooks::run(
'OutputPageBodyAttributes', [ $this, $sk, &$bodyAttrs ] );
2690 return WrappedStringList::join(
"\n", $pieces );
2699 if ( is_null( $this->mResourceLoader ) ) {
2702 LoggerFactory::getInstance(
'resourceloader' )
2719 $modules = (
array)$modules;
2728 if ( !count( $modules ) ) {
2732 if ( count( $modules ) > 1 ) {
2734 $modules = array_unique( $modules );
2740 foreach ( $modules
as $name ) {
2742 $links[
'html'] = array_merge( $links[
'html'],
$link[
'html'] );
2743 $links[
'states'] +=
$link[
'states'];
2749 if ( !is_null( $this->mTarget ) ) {
2754 $sortedModules = [];
2756 foreach ( $modules
as $name ) {
2758 # Check that we're allowed to include this module on this page
2766 || ( $this->mTarget && !in_array( $this->mTarget, $module->getTargets() ) )
2774 $logger->debug(
'Unexpected general module "{module}" in styles queue.', [
2778 $links[
'states'][
$name] =
'ready';
2782 $sortedModules[$module->getSource()][$module->getGroup()][
$name] = $module;
2785 foreach ( $sortedModules
as $source => $groups ) {
2786 foreach ( $groups
as $group => $grpModules ) {
2789 if ( ( $group ===
'user' || $group ===
'private' ) && $this->
getUser()->isLoggedIn() ) {
2798 $this->
getSkin()->getSkinName(),
2812 foreach ( $grpModules
as $key => $module ) {
2815 if ( $module->isKnownEmpty(
$context ) ) {
2816 unset( $grpModules[$key] );
2818 $links[
'states'][$key] =
'ready';
2822 $isRaw |= $module->isRaw();
2826 if ( count( $grpModules ) === 0 ) {
2834 if ( $group ===
'private' ) {
2853 if ( $group ===
'user' ) {
2865 if (
$context->getRaw() || $isRaw ) {
2869 'async' => !isset( $extraQuery[
'sync'] ),
2880 foreach ( $grpModules
as $key => $module ) {
2882 if ( $key !==
'startup' ) {
2883 $links[
'states'][$key] =
'loading';
2888 if ( $group ==
'noscript' ) {
2891 $links[
'html'][] =
$link;
2908 if ( !is_array( $link ) ) {
2912 $states += $link[
'states'];
2924 return WrappedString::join(
"\n",
$html );
2948 return self::getHtmlFromLoaderLinks( $links );
2966 'document.documentElement.className = document.documentElement.className'
2967 .
'.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );'
2978 $embedScripts = [
'user.options' ];
3004 return self::getHtmlFromLoaderLinks( $links );
3027 $modules = $this->
getModules(
true,
'bottom' );
3040 if ( $this->
getConfig()->
get(
'AllowUserJs' )
3041 && $this->
getUser()->isLoggedIn()
3043 && $this->
getTitle()->isJsSubpage()
3049 [
'excludepage' => $this->
getTitle()->getPrefixedDBkey() ]
3076 return self::getHtmlFromLoaderLinks( $links );
3087 [
'wgPageParseReport' => $this->limitReportData ],
3110 if ( is_array(
$keys ) ) {
3112 $this->mJsConfigVars[$key] =
$value;
3134 $canonicalSpecialPageName =
false; # bug 21115
3137 $ns = $title->getNamespace();
3140 : $title->getNsText();
3145 $relevantTitle = $sk->getRelevantTitle();
3146 $relevantUser = $sk->getRelevantUser();
3149 list( $canonicalSpecialPageName, ) =
3153 $curRevisionId = $wikiPage->getLatest();
3154 $articleId = $wikiPage->getId();
3157 $lang = $title->getPageViewLanguage();
3160 $separatorTransTable =
$lang->separatorTransformTable();
3161 $separatorTransTable = $separatorTransTable ? $separatorTransTable : [];
3162 $compactSeparatorTransTable = [
3163 implode(
"\t", array_keys( $separatorTransTable ) ),
3164 implode(
"\t", $separatorTransTable ),
3166 $digitTransTable =
$lang->digitTransformTable();
3167 $digitTransTable = $digitTransTable ? $digitTransTable : [];
3168 $compactDigitTransTable = [
3169 implode(
"\t", array_keys( $digitTransTable ) ),
3170 implode(
"\t", $digitTransTable ),
3176 'wgCanonicalNamespace' => $canonicalNamespace,
3177 'wgCanonicalSpecialPageName' => $canonicalSpecialPageName,
3178 'wgNamespaceNumber' => $title->getNamespace(),
3179 'wgPageName' => $title->getPrefixedDBkey(),
3180 'wgTitle' => $title->getText(),
3181 'wgCurRevisionId' => $curRevisionId,
3183 'wgArticleId' => $articleId,
3185 'wgIsRedirect' => $title->isRedirect(),
3187 'wgUserName' =>
$user->isAnon() ? null :
$user->getName(),
3188 'wgUserGroups' =>
$user->getEffectiveGroups(),
3191 'wgPageContentLanguage' =>
$lang->getCode(),
3192 'wgPageContentModel' => $title->getContentModel(),
3193 'wgSeparatorTransformTable' => $compactSeparatorTransTable,
3194 'wgDigitTransformTable' => $compactDigitTransTable,
3195 'wgDefaultDateFormat' =>
$lang->getDefaultDateFormat(),
3196 'wgMonthNames' =>
$lang->getMonthNamesArray(),
3197 'wgMonthNamesShort' =>
$lang->getMonthAbbreviationsArray(),
3198 'wgRelevantPageName' => $relevantTitle->getPrefixedDBkey(),
3199 'wgRelevantArticleId' => $relevantTitle->getArticleID(),
3203 if (
$user->isLoggedIn() ) {
3205 $vars[
'wgUserEditCount'] =
$user->getEditCount();
3207 $vars[
'wgUserRegistration'] = $userReg !== null ? ( $userReg * 1000 ) : null;
3211 $vars[
'wgUserNewMsgRevisionId'] =
$user->getNewMessageRevisionId();
3214 if ( $wgContLang->hasVariants() ) {
3215 $vars[
'wgUserVariant'] = $wgContLang->getPreferredVariant();
3218 $vars[
'wgIsProbablyEditable'] = $title->quickUserCan(
'edit',
$user )
3219 && ( $title->exists() || $title->quickUserCan(
'create',
$user ) );
3221 foreach ( $title->getRestrictionTypes()
as $type ) {
3222 $vars[
'wgRestriction' . ucfirst(
$type )] = $title->getRestrictions(
$type );
3225 if ( $title->isMainPage() ) {
3226 $vars[
'wgIsMainPage'] =
true;
3229 if ( $this->mRedirectedFrom ) {
3230 $vars[
'wgRedirectedFrom'] = $this->mRedirectedFrom->getPrefixedDBkey();
3233 if ( $relevantUser ) {
3234 $vars[
'wgRelevantUserName'] = $relevantUser->getName();
3259 $request->getVal(
'action' ) !==
'submit' ||
3260 !
$request->getCheck(
'wpPreview' ) ||
3267 if ( !
$user->matchEditToken(
$request->getVal(
'wpEditToken' ) ) ) {
3272 if ( !
$title->isJsSubpage() && !
$title->isCssSubpage() ) {
3275 if ( !
$title->isSubpageOf(
$user->getUserPage() ) ) {
3280 $errors =
$title->getUserPermissionsErrors(
'edit',
$user );
3281 if ( count( $errors ) !== 0 ) {
3300 'name' =>
'generator',
3301 'content' =>
"MediaWiki $wgVersion",
3304 if ( $config->get(
'ReferrerPolicy' ) !==
false ) {
3306 'name' =>
'referrer',
3307 'content' => $config->get(
'ReferrerPolicy' )
3311 $p =
"{$this->mIndexPolicy},{$this->mFollowPolicy}";
3312 if ( $p !==
'index,follow' ) {
3321 foreach ( $this->mMetatags
as $tag ) {
3322 if ( 0 == strcasecmp(
'http:', substr( $tag[0], 0, 5 ) ) ) {
3324 $tag[0] = substr( $tag[0], 5 );
3328 $tagName =
"meta-{$tag[0]}";
3329 if ( isset( $tags[$tagName] ) ) {
3330 $tagName .= $tag[1];
3335 'content' => $tag[1]
3340 foreach ( $this->mLinktags
as $tag ) {
3344 # Universal edit button
3345 if ( $config->get(
'UniversalEditButton' ) && $this->
isArticleRelated() ) {
3348 && ( $this->
getTitle()->exists() ||
3352 $msg = $this->
msg(
'edit' )->text();
3354 'rel' =>
'alternate',
3355 'type' =>
'application/x-wiki',
3357 'href' => $this->
getTitle()->getEditURL(),
3363 'href' => $this->
getTitle()->getEditURL(),
3368 # Generally the order of the favicon and apple-touch-icon links
3369 # should not matter, but Konqueror (3.5.9 at least) incorrectly
3370 # uses whichever one appears later in the HTML source. Make sure
3371 # apple-touch-icon is specified first to avoid this.
3372 if ( $config->get(
'AppleTouchIcon' ) !==
false ) {
3374 'rel' =>
'apple-touch-icon',
3375 'href' => $config->get(
'AppleTouchIcon' )
3379 if ( $config->get(
'Favicon' ) !==
false ) {
3381 'rel' =>
'shortcut icon',
3382 'href' => $config->get(
'Favicon' )
3386 # OpenSearch description link
3389 'type' =>
'application/opensearchdescription+xml',
3390 'href' =>
wfScript(
'opensearch_desc' ),
3391 'title' => $this->
msg(
'opensearch-desc' )->inContentLanguage()->
text(),
3394 if ( $config->get(
'EnableAPI' ) ) {
3395 # Real Simple Discovery link, provides auto-discovery information
3396 # for the MediaWiki API (and potentially additional custom API
3397 # support such as WordPress or Twitter-compatible APIs for a
3398 # blogging extension, etc)
3401 'type' =>
'application/rsd+xml',
3407 [
'action' =>
'rsd' ] ),
3414 if ( !$config->get(
'DisableLangConversion' ) ) {
3416 if (
$lang->hasVariants() ) {
3417 $variants =
$lang->getVariants();
3418 foreach ( $variants
as $variant ) {
3420 'rel' =>
'alternate',
3421 'hreflang' =>
wfBCP47( $variant ),
3422 'href' => $this->
getTitle()->getLocalURL(
3423 [
'variant' => $variant ] )
3427 # x-default link per https://support.google.com/webmasters/answer/189077?hl=en
3429 'rel' =>
'alternate',
3430 'hreflang' =>
'x-default',
3431 'href' => $this->
getTitle()->getLocalURL() ] );
3436 if ( $this->copyrightUrl !== null ) {
3440 if ( $config->get(
'RightsPage' ) ) {
3444 $copyright = $copy->getLocalURL();
3448 if ( !$copyright && $config->get(
'RightsUrl' ) ) {
3449 $copyright = $config->get(
'RightsUrl' );
3455 'rel' =>
'copyright',
3456 'href' => $copyright ]
3461 if ( $config->get(
'Feed' ) ) {
3465 # Use the page name for the title. In principle, this could
3466 # lead to issues with having the same name for different feeds
3467 # corresponding to the same page, but we can't avoid that at
3473 # Used
messages:
'page-rss-feed' and 'page-atom-feed' (
for an easier grep)
3475 "page-{$format}-feed", $this->
getTitle()->getPrefixedText()
3480 # Recent changes feed should appear on every page (except recentchanges,
3481 # that would be redundant). Put it after the per-page feed to avoid
3482 # changing existing behavior. It's still available, probably via a
3483 # menu in your browser. Some sites might have a different feed they'd
3484 # like to promote instead of the RC feed (maybe like a "Recent New Articles"
3485 # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
3486 # If so, use it instead.
3487 $sitename = $config->get(
'Sitename' );
3488 if ( $config->get(
'OverrideSiteFeed' ) ) {
3489 foreach ( $config->get(
'OverrideSiteFeed' )
as $type => $feedUrl ) {
3494 $this->
msg(
"site-{$type}-feed", $sitename )->
text()
3497 } elseif ( !$this->
getTitle()->isSpecial(
'Recentchanges' ) ) {
3499 foreach ( $config->get(
'AdvertisedFeedTypes' )
as $format ) {
3502 $rctitle->getLocalURL( [
'feed' => $format ] ),
3503 # For grep: 'site-rss-feed', 'site-atom-feed'
3504 $this->
msg(
"site-{$format}-feed", $sitename )->text()
3509 # Allow extensions to change the list pf feeds. This hook is primarily for changing,
3510 # manipulating or removing existing feed tags. If you want to add new feeds, you should
3511 # use OutputPage::addFeedLink() instead.
3512 Hooks::run(
'AfterBuildFeedLinks', [ &$feedLinks ] );
3514 $tags += $feedLinks;
3518 if ( $config->get(
'EnableCanonicalServerLink' ) ) {
3519 if ( $canonicalUrl !==
false ) {
3531 if ( in_array( $action, [
'history',
'info' ] ) ) {
3532 $query =
"action={$action}";
3538 $reqUrl = $this->
getRequest()->getRequestURL();
3543 if ( $canonicalUrl !==
false ) {
3545 'rel' =>
'canonical',
3546 'href' => $canonicalUrl
3573 'rel' =>
'alternate',
3574 'type' =>
"application/$type+xml",
3589 public function addStyle( $style, $media =
'', $condition =
'',
$dir =
'' ) {
3595 $options[
'condition'] = $condition;
3611 if ( $flip ===
'flip' && $this->
getLanguage()->isRTL() ) {
3612 # If wanted, and the interface is right-to-left, flip the CSS
3613 $style_css = CSSJanus::transform( $style_css,
true,
false );
3626 $this->
getSkin()->setupSkinUserCss( $this );
3644 $moduleStyles[] =
'site.styles';
3645 $moduleStyles[] =
'noscript';
3648 if ( $this->
getConfig()->
get(
'AllowUserCss' ) && $this->
getTitle()->isCssSubpage()
3654 [
'excludepage' => $this->
getTitle()->getPrefixedDBkey() ]
3656 $otherTags = array_merge( $otherTags,
$link[
'html'] );
3661 $previewedCSS = $this->
getRequest()->getText(
'wpTextbox1' );
3662 if ( $this->
getLanguage()->getDir() !== $wgContLang->getDir() ) {
3663 $previewedCSS = CSSJanus::transform( $previewedCSS,
true,
false );
3668 $moduleStyles[] =
'user';
3672 $moduleStyles[] =
'user.cssprefs';
3674 foreach ( $moduleStyles
as $name ) {
3679 if ( $name ===
'site.styles' ) {
3687 $group = $module->getGroup();
3710 [
'name' =>
'ResourceLoaderDynamicStyles',
'content' =>
'' ]
3716 foreach ( [
'site',
'noscript',
'private',
'user' ]
as $group ) {
3723 $links[] = implode(
'', $otherTags );
3725 return self::getHtmlFromLoaderLinks( $links );
3735 foreach ( $this->mExtStyles
as $url ) {
3738 $this->mExtStyles = [];
3740 foreach ( $this->styles
as $file =>
$options ) {
3743 $links[$file] =
$link;
3757 if ( isset( $options[
'dir'] ) ) {
3758 if ( $this->
getLanguage()->getDir() != $options[
'dir'] ) {
3763 if ( isset( $options[
'media'] ) ) {
3764 $media = self::transformCssMedia( $options[
'media'] );
3765 if ( is_null( $media ) ) {
3772 if ( substr( $style, 0, 1 ) ==
'/' ||
3773 substr( $style, 0, 5 ) ==
'http:' ||
3774 substr( $style, 0, 6 ) ==
'https:' ) {
3778 $url = $config->get(
'StylePath' ) .
'/' . $style .
'?' .
3779 $config->get(
'StyleVersion' );
3784 if ( isset( $options[
'condition'] ) ) {
3785 $condition = htmlspecialchars( $options[
'condition'] );
3786 $link =
"<!--[if $condition]>$link<![endif]-->";
3814 $remotePathPrefix = $config->
get(
'ResourceBasePath' );
3815 if ( $remotePathPrefix ===
'' ) {
3820 $remotePath = $remotePathPrefix;
3822 if ( strpos(
$path, $remotePath ) !== 0 ) {
3826 $path = RelPath\getRelativePath(
$path, $remotePath );
3827 return self::transformFilePath( $remotePathPrefix, $IP,
$path );
3842 $hash = md5_file(
"$localPath/$file" );
3843 if ( $hash ===
false ) {
3844 wfLogWarning( __METHOD__ .
": Failed to hash $localPath/$file" );
3847 return "$remotePathPrefix/$file?" . substr( $hash, 0, 5 );
3861 $screenMediaQueryRegex =
'/^(?:only\s+)?screen\b/i';
3865 'printable' =>
'print',
3866 'handheld' =>
'handheld',
3868 foreach ( $switches
as $switch => $targetMedia ) {
3869 if ( $wgRequest->getBool( $switch ) ) {
3870 if ( $media == $targetMedia ) {
3872 } elseif ( preg_match( $screenMediaQueryRegex, $media ) === 1 ) {
3886 if ( $targetMedia ==
'print' || $media ==
'screen' ) {
3903 $args = func_get_args();
3946 $msgSpecs = func_get_args();
3947 array_shift( $msgSpecs );
3948 $msgSpecs = array_values( $msgSpecs );
3950 foreach ( $msgSpecs
as $n => $spec ) {
3951 if ( is_array( $spec ) ) {
3954 if ( isset(
$args[
'options'] ) ) {
3955 unset(
$args[
'options'] );
3957 'Adding "options" to ' . __METHOD__ .
' is no longer supported',
3976 $this->mEnableTOC = $flag;
3993 $this->mEnableSectionEditLinks = $flag;
4014 $themes = array_change_key_case( $themes, CASE_LOWER );
4015 $theme = isset( $themes[$skinName] ) ? $themes[$skinName] :
'MediaWiki';
4017 $themeClass =
"OOUI\\{$theme}Theme";
4018 OOUI\Theme::setSingleton(
new $themeClass() );
4019 OOUI\Element::setDefaultDir(
$dir );
4030 strtolower( $this->
getSkin()->getSkinName() ),
4034 'oojs-ui-core.styles',
4035 'oojs-ui.styles.icons',
4036 'oojs-ui.styles.indicators',
4037 'oojs-ui.styles.textures',
4038 'mediawiki.widgets.styles',
4042 $this->
addMeta(
'X-OOUI-PHP',
'1' );
getPreventClickjacking()
Get the prevent-clickjacking flag.
setContext(IContextSource $context)
Set the IContextSource object.
addInlineStyle($style_css, $flip= 'noflip')
Adds inline CSS styles Internal use only.
const TS_RFC2822
RFC 2822 format, for E-mail and HTTP headers.
prependHTML($text)
Prepend $text to the body HTML.
isDisabled()
Return whether the output will be completely disabled.
static closeElement($element)
Returns "</$element>".
showFileRenameError($old, $new)
static newFromContext(IContextSource $context)
Get a ParserOptions object from a IContextSource object.
ResourceLoader $mResourceLoader
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
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
Interface for objects which can provide a MediaWiki context on request.
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
getPageTitleActionText()
Get the value of the "action text".
getMetadataAttribute()
Get the value of the "rel" attribute for metadata links.
getHeadItemsArray()
Get an array of head items.
static inlineScript($contents)
Output a "<script>" tag with the given contents.
addHTML($text)
Append $text to the body HTML.
sendCacheControl()
Send cache control HTTP headers.
$mScripts
Used for JavaScript (predates ResourceLoader)
int $mCdnMaxage
Cache stuff.
the array() calling protocol came about after MediaWiki 1.4rc1.
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
addInlineScript($script)
Add a self-contained script tag with the given contents Internal use only.
addScript($script)
Add raw HTML to the list of scripts (including \<script\> tag, etc.) Internal use only...
showLagWarning($lag)
Show a warning about slave lag.
getLanguage()
Get the Language object.
getHTMLTitle()
Return the "HTML title", i.e.
int $mCdnMaxageLimit
Upper limit on mCdnMaxage.
addSubtitle($str)
Add $str to the subtitle.
static getRequestId()
Get the unique request ID.
The main skin class which provides methods and properties for all other skins.
$wgVersion
MediaWiki version number.
$mDebugtext
Holds the debug lines that will be output as comments in page source if $wgDebugComments is enabled...
addToBodyAttributes($out, &$bodyAttrs)
This will be called by OutputPage::headElement when it is creating the "<body>" tag, skins can override it if they have a need to add in any body attributes or classes of their own.
bool $mEnableTOC
Whether parser output should contain table of contents.
makeResourceLoaderLink($modules, $only, array $extraQuery=[])
Construct neccecary html and loader preset states to load modules on a page.
rateLimited()
Turn off regular page output and return an error response for when rate limiting has triggered...
wfScript($script= 'index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
setHTMLTitle($name)
"HTML title" means the contents of "<title>".
addWikiTextTitle($text, Title $title, $linestart, $tidy=false, $interface=false)
Add wikitext with a custom Title object.
processing should stop and the error should be shown to the user * false
static newMainPage()
Create a new Title for the Main Page.
getCanonicalUrl()
Returns the URL to be used for the <link rel="canonical"> if one is set.
parserOptions($options=null)
Get/set the ParserOptions object to use for wikitext parsing.
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
addParserOutputMetadata($parserOutput)
Add all metadata associated with a ParserOutput object, but without the actual HTML.
error also a ContextSource you ll probably need to make sure the header is varied on such as when responding to a resource loader request or generating HTML output & $resourceLoader
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
buildCssLinks()
Build a set of "<link>" elements for stylesheets specified in the $this->styles array.
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
hasHeadItem($name)
Check if the header item $name is already set.
setLanguageLinks(array $newLinkArray)
Reset the language links and add new language links.
The Message class provides methods which fulfil two basic services:
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
string $mInlineStyles
Inline CSS styles.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
array $mMetatags
Should be private.
addCategoryLinks(array $categories)
Add an array of categories, with names in the keys.
haveCacheVaryCookies()
Check if the request has a cache-varying cookie header If it does, it's very important that we don't ...
getPageTitle()
Return the "page title", i.e.
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
setSubtitle($str)
Replace the subtitle with $str.
addWikiMsgArray($name, $args)
Add a wikitext-formatted message to the output.
addFeedLink($format, $href)
Add a feed link to the page header.
sectionEditLinksEnabled()
if(!isset($args[0])) $lang
setArticleRelated($v)
Set whether this page is related an article on the wiki Setting false will cause the change of "artic...
readOnlyPage()
Display a page stating that the Wiki is in read-only mode.
checkLastModified($timestamp)
checkLastModified tells the client to use the client-cached page if possible.
addScriptFile($file, $version=null)
Add a JavaScript file out of skins/common, or a given relative path.
array $mHeadItems
Array of elements in "<head>".
allowClickjacking()
Turn off frame-breaking.
setFeedAppendQuery($val)
Add default feeds to the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version.
isRedirect($flags=0)
Is this an article that is a redirect page? Uses link cache, adding it if necessary.
array $mExtStyles
Additional stylesheets.
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
getExtStyle()
Get all styles added by extensions.
returnToMain($unused=null, $returnto=null, $returntoquery=null)
Add a "return to" link pointing to a specified title, or the title indicated in the request...
addWikiTextTitleTidy($text, &$title, $linestart=true)
Add wikitext with a custom Title object and tidy enabled.
static linkedScript($url)
Output a "<script>" tag linking to the given URL, e.g., "<script src=foo.js></script>".
string null $mTarget
ResourceLoader target for load.php links.
getArticleBodyOnly()
Return whether the output will contain only the body of the article.
static escapeClass($class)
Given a value, escape it so that it can be used as a CSS class and return it.
addHelpLink($to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
filterModules(array $modules, $position=null, $type=ResourceLoaderModule::TYPE_COMBINED)
Filter an array of modules to remove insufficiently trustworthy members, and modules which are no lon...
string $mPageLinkTitle
Used by skin template.
addParserOutputContent($parserOutput)
Add the HTML and enhancements for it (like ResourceLoader modules) associated with a ParserOutput obj...
userCanPreview()
To make it harder for someone to slip a user a fake user-JavaScript or user-CSS preview, a random token is associated with the login session.
addParserOutputText($parserOutput)
Add the HTML associated with a ParserOutput object, without any metadata.
setPrintable()
Set the page as printable, i.e.
string null $copyrightUrl
The URL to send in a <link> element with rel=copyright.
disable()
Disable output completely, i.e.
static exists($index)
Returns whether the specified namespace exists.
wfUrlencode($s)
We want some things to be included as literal characters in our title URLs for prettiness, which urlencode encodes by default.
setStatusCode($statusCode)
Set the HTTP status code to send with the output.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
this hook is for auditing only $response
Represents a title within MediaWiki.
addExtensionStyle($url)
Register and add a stylesheet from an extension directory.
static stripAllTags($text)
Take a fragment of (potentially invalid) HTML and return a version with any tags removed, encoded as plain text.
when a variable name is used in a it is silently declared as a new local masking the global
const ORIGIN_CORE_INDIVIDUAL
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
formatPermissionsErrorMessage(array $errors, $action=null)
Format a list of error messages.
string $mRevisionTimestamp
array $mLanguageLinks
Array of Interwiki Prefixed (non DB key) Titles (e.g.
getFileSearchOptions()
Get the files used on this page.
setCategoryLinks(array $categories)
Reset the category links (but not the category list) and add $categories.
isSyndicated()
Should we output feed links for this page?
array $styles
An array of stylesheet filenames (relative from skins path), with options for CSS media...
isPrintable()
Return whether the page is "printable".
getTitle()
Get the Title object.
prepareErrorPage($pageTitle, $htmlTitle=false)
Prepare this object to display an error page; disable caching and indexing, clear the current text an...
$mProperties
Additional key => value data.
get($name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
getAllowedModules($type)
Show what level of JavaScript / CSS untrustworthiness is allowed on this page.
addElement($element, array $attribs=[], $contents= '')
Shortcut for adding an Html::element via addHTML.
array bool $mDoNothing
Whether output is disabled.
addModules($modules)
Add one or more modules recognized by ResourceLoader.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
reduceAllowedModules($type, $level)
Limit the highest level of CSS/JS untrustworthiness allowed.
setPageTitleActionText($text)
Set the new value of the "action text", this will be added to the "HTML title", separated from it wit...
bool $mPreventClickjacking
Controls if anti-clickjacking / frame-breaking headers will be sent.
addMetadataLink(array $linkarr)
Add a new \<link\> with "rel" attribute set to "meta".
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping $template
preventClickjacking($enable=true)
Set a flag which will cause an X-Frame-Options header appropriate for edit pages to be sent...
enableClientCache($state)
Use enableClientCache(false) to force it to send nocache headers.
getCategories()
Get the list of category names this page belongs to.
getJsConfigVars()
Get the javascript config vars to include on this page.
enableOOUI()
Add ResourceLoader module styles for OOUI and set up the PHP implementation of it for use with MediaW...
addParserOutput($parserOutput)
Add everything from a ParserOutput object.
static makeConfigSetScript(array $configuration, $pretty=null)
Returns JS code which will set the MediaWiki configuration array to the given value.
bool $mPrintable
We have to set isPrintable().
static makeLoaderStateScript($name, $state=null)
Returns a JS call to mw.loader.state, which sets the state of a module or modules to a given value...
clearSubtitle()
Clear the subtitles.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getRequest()
Get the WebRequest object.
addWikiTextWithTitle($text, &$title, $linestart=true)
Add wikitext with a custom Title object.
getHeadScripts()
JS stuff to put in the "<head>".
bool $mIsArticleRelated
Stores "article flag" toggle.
canUseWikiPage()
Check whether a WikiPage object can be get with getWikiPage().
getExternalHeadScripts()
<script src="..."> tags for "<head>".This is the startup module and other modules marked with pos...
array $mAllowedModules
What level of 'untrustworthiness' is allowed in CSS/JS modules loaded on this page?
bool $mNoGallery
Comes from the parser.
static transformFilePath($remotePathPrefix, $localPath, $file)
Utility method for transformResourceFilePath().
getTemplateIds()
Get the templates used on this page.
wfCgiToArray($query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
setCopyrightUrl($url)
Set the copyright URL to send with the output.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
getHTML()
Get the body HTML.
static buildBacklinkSubtitle(Title $title, $query=[])
Build message object for a subtitle containing a backlink to a page.
feedLink($type, $url, $text)
Generate a "<link rel/>" for a feed.
static openElement($element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
getLanguageLinks()
Get the list of language links.
addAcceptLanguage()
T23672: Add Accept-Language to Vary and Key headers if there's no 'variant' parameter existed in GET...
static stripOuterParagraph($html)
Strip outer.
static groupHasPermission($group, $role)
Check, if the given group has the given permission.
Interface for configuration instances.
static singleton()
Get an instance of this class.
static getCanonicalName($index)
Returns the canonical (English) name for a given index.
addWikiText($text, $linestart=true, $interface=true)
Convert wikitext to HTML and add it to the buffer Default assumes that the current page title will be...
wfAppendQuery($url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
headElement(Skin $sk, $includeStyle=true)
getJSVars()
Get an array containing the variables to be set in mw.config in JavaScript.
static transformResourcePath(Config $config, $path)
Transform path to web-accessible static resource.
getModuleScripts($filter=false, $position=null)
Get the list of module JS to include on this page.
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 $parserOutput
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
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
$mFeedLinks
Handles the Atom / RSS links.
getSubtitle()
Get the subtitle.
isArticleRelated()
Return whether this page is related an article on the wiki.
setRedirectedFrom($t)
Set $mRedirectedFrom, the Title of the page which redirected us to the current page.
showErrorPage($title, $msg, $params=[])
Output a standard error page.
getConfig()
Get the Config object.
getMetaTags()
Returns the current <meta> tags.
lowerCdnMaxage($maxage)
Lower the value of the "s-maxage" part of the "Cache-control" HTTP header.
getCategoryLinks()
Get the list of category links, in a 2-D array with the following format: $arr[$type][] = $link...
bool $mArticleBodyOnly
Flag if output should only contain the body of the article.
setPageTitle($name)
"Page title" means the contents of \<h1\>.
setRobotPolicy($policy)
Set the robot policy for the page: http://www.robotstxt.org/meta.html
bool $mEnableSectionEditLinks
Whether parser output should contain section edit links.
getInlineHeadScripts()
Inline "<script>" tags to put in "<head>".
addTemplate(&$template)
Add the output of a QuickTemplate to the output buffer.
clearHTML()
Clear the body HTML.
getFrameOptions()
Get the X-Frame-Options header value (without the name part), or false if there isn't one...
A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to interpret a given string a...
setCdnMaxage($maxage)
Set the value of the "s-maxage" part of the "Cache-control" HTTP header.
enableSectionEditLinks($flag=true)
Enables/disables section edit links, doesn't override NOEDITSECTION
getIndicators()
Get the indicators associated with this page.
getContext()
Get the base IContextSource object.
addWikiMsg()
Add a wikitext-formatted message to the output.
static makePackedModulesString($modules)
Convert an array of module names to a packed query string.
showNewSectionLink()
Show an "add new section" link?
Title $mRedirectedFrom
If the current page was reached through a redirect, $mRedirectedFrom contains the Title of the redire...
const ORIGIN_USER_SITEWIDE
and(b) You must cause any modified files to carry prominent notices stating that You changed the files
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
string $mHTMLtitle
Stores contents of "<title>" tag.
bool $mHideNewSectionLink
string $mBodytext
Contains all of the "<body>" content.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
getModuleStyles($filter=false, $position=null)
Get the list of module CSS to include on this page.
parseInline($text, $linestart=true, $interface=false)
Parse wikitext, strip paragraphs, and return the HTML.
styleLink($style, array $options)
Generate \<link\> tags for stylesheets.
static makeInlineScript($script)
Construct an inline script tag with given JS code.
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 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 after processing after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock()-offset Set to overwrite offset parameter in $wgRequest set to ''to unsetoffset-wrap String Wrap the message in html(usually something like"<
getHtmlElementAttributes()
Return values for <html> element.
wfBCP47($code)
Get the normalised IETF language tag See unit test for examples.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static addModules(OutputPage $out)
Add ResourceLoader modules to the OutputPage object if debugging is enabled.
addLink(array $linkarr)
Add a new \<link\> tag to the page header.
addStyle($style, $media= '', $condition= '', $dir= '')
Add a local or specified stylesheet, with the given media options.
static inlineStyle($contents, $media= 'all')
Output a "<style>" tag with the given contents for the given media type (if any). ...
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
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
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
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
showFileNotFoundError($name)
setFollowPolicy($policy)
Set the follow policy for the page, but leave the index policy un- touched.
static htmlHeader(array $attribs=[])
Constructs the opening html-tag with necessary doctypes depending on global variables.
getPageClasses($title)
TODO: document.
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
addVaryHeader($header, array $option=null)
Add an HTTP header that will influence on the cache.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
This class should be covered by a general architecture document which does not exist as of January 20...
parse($text, $linestart=true, $interface=false, $language=null)
Parse wikitext and return the HTML.
static newFromAnon()
Get a ParserOptions object for an anonymous user.
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
static link($target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
getFeedAppendQuery()
Will currently always return null.
static getSelectFields()
Fields that LinkCache needs to select.
setTarget($target)
Sets ResourceLoader target for load.php links.
setTitle(Title $t)
Set the Title object to use.
addBacklinkSubtitle(Title $title, $query=[])
Add a subtitle containing a backlink to a page.
addMeta($name, $val)
Add a new "<meta>" tag To add an http-equiv meta tag, precede the name with "http:".
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
addLanguageLinks(array $newLinkArray)
Add new language links.
wfGetAllCallers($limit=3)
Return a string consisting of callers in the stack.
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'you ll need to handle error messages
string $mLastModified
Used for sending cache control.
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
wfSetVar(&$dest, $source, $force=false)
Sets dest to source and returns the original value of dest If source is NULL, it just returns the val...
static inDebugMode()
Determine whether debug mode was requested Order of priority is 1) request param, 2) cookie...
addParserOutputNoText($parserOutput)
Add a ParserOutput object, but without Html.
static removeHTMLtags($text, $processCallback=null, $args=[], $extratags=[], $removetags=[], $warnCallback=null)
Cleans up HTML, removes dangerous tags and attributes, and removes HTML comments. ...
error also a ContextSource you ll probably need to make sure the header is varied on $request
int $mRevisionId
To include the variable {{REVISIONID}}.
setRevisionTimestamp($timestamp)
Set the timestamp of the revision which will be displayed.
showFileCopyError($old, $new)
getSyndicationLinks()
Return URLs for each supported syndication format for this page.
versionRequired($version)
Display an error page indicating that a given version of MediaWiki is required to use it...
static resolveAlias($alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
enableTOC($flag=true)
Enables/disables TOC, doesn't override NOTOC
static transformCssMedia($media)
Transform "media" attribute based on request parameters.
static normalizeCharReferences($text)
Ensure that any entities and character references are legal for XML and XHTML specifically.
setArticleBodyOnly($only)
Set whether the output should only contain the body of the article, without any skin, sidebar, etc.
getProperty($name)
Get an additional output property.
WebRequest clone which takes values from a provided array.
addHeadItem($name, $value)
Add or replace an header item to the output.
output()
Finally, all the text has been munged and accumulated into the object, let's actually output it: ...
static isXmlMimeType($mimetype)
Determines if the given MIME type is xml.
exists()
Returns true if file exists in the repository.
wfArrayToCgi($array1, $array2=null, $prefix= '')
This function takes one or two arrays as input, and returns a CGI-style string, e.g.
array $limitReportData
Profiling data.
__construct(IContextSource $context=null)
Constructor for OutputPage.
getResourceLoader()
Get a ResourceLoader object associated with this OutputPage.
getRevisionId()
Get the displayed revision ID.
static setupOOUI($skinName= '', $dir= 'ltr')
Helper function to setup the PHP implementation of OOUI to use in this request.
wfClearOutputBuffers()
More legible than passing a 'false' parameter to wfResetOutputBuffers():
getFileVersion()
Get the displayed file version.
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
setIndexPolicy($policy)
Set the index policy for the page, but leave the follow policy un- touched.
getScriptsForBottomQueue($unused=null)
JS stuff to put at the 'bottom', which goes at the bottom of the <body>.
setProperty($name, $value)
Set an additional output property.
forceHideNewSectionLink()
Forcibly hide the new section link?
MediaWiki Logger LoggerFactory implements a PSR[0] compatible message logging system Named Psr Log LoggerInterface instances can be obtained from the MediaWiki Logger LoggerFactory::getInstance() static method.MediaWiki\Logger\LoggerFactory expects a class implementing the MediaWiki\Logger\Spi interface to act as a factory for new Psr\Log\LoggerInterface instances.The"Spi"in MediaWiki\Logger\Spi stands for"service provider interface".An SPI is an API intended to be implemented or extended by a third party.This software design pattern is intended to enable framework extension and replaceable components.It is specifically used in the MediaWiki\Logger\LoggerFactory service to allow alternate PSR-3 logging implementations to be easily integrated with MediaWiki.The service provider interface allows the backend logging library to be implemented in multiple ways.The $wgMWLoggerDefaultSpi global provides the classname of the default MediaWiki\Logger\Spi implementation to be loaded at runtime.This can either be the name of a class implementing the MediaWiki\Logger\Spi with a zero argument const ructor or a callable that will return an MediaWiki\Logger\Spi instance.Alternately the MediaWiki\Logger\LoggerFactory MediaWiki Logger LoggerFactory
wrapWikiMsg($wrap)
This function takes a number of message/argument specifications, wraps them in some overall structure...
bool $mIsarticle
Is the displayed content related to the source of the corresponding wiki article. ...
getBottomScripts()
JS stuff to put at the bottom of the "<body>".
setFileVersion($file)
Set the displayed file version.
getRedirect()
Get the URL to redirect to, or an empty string if not redirect URL set.
addReturnTo($title, array $query=[], $text=null, $options=[])
Add a "return to" link pointing to a specified title.
static makeLoaderQuery($modules, $lang, $skin, $user=null, $version=null, $debug=false, $only=null, $printable=false, $handheld=false, $extraQuery=[])
Build a query array (array representation of query string) for load.php.
setRevisionId($revid)
Set the revision ID which will be seen by the wiki text parser for things such as embedded {{REVISION...
getKeyHeader()
Get a complete Key header.
setArray($array)
Set the link list to a given 2-d array First key is the namespace, second is the DB key...
showUnexpectedValueError($name, $val)
wfLogWarning($msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
array $mSubtitle
Contains the page subtitle.
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
redirect($url, $responsecode= '302')
Redirect to $url rather than displaying the normal page.
string $mPagetitle
Should be private - has getter and setter.
static getHtmlFromLoaderLinks(array $links)
Build html output from an array of links from makeResourceLoaderLink.
showPermissionsErrorPage(array $errors, $action=null)
Output a standard permission error page.
getCacheVaryCookies()
Get the list of cookies that will influence on the cache.
wfTimestampOrNull($outputtype=TS_UNIX, $ts=null)
Return a formatted timestamp, or null if input is null.
setArticleFlag($v)
Set whether the displayed content is related to the source of the corresponding article on the wiki S...
showFileDeleteError($name)
static encodeJsCall($name, $args, $pretty=false)
Create a call to a JavaScript function.
Implements some public methods and some protected utility functions which are required by multiple ch...
addWikiTextTidy($text, $linestart=true)
Add wikitext with tidy enabled.
string $mPageTitleActionText
Dynamic JavaScript and CSS resource loading system.
getWikiPage()
Get the WikiPage object.
static linkedStyle($url, $media= 'all')
Output a "<link rel=stylesheet>" linking to the given URL for the given media type (if any)...
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
setIndicators(array $indicators)
Add an array of indicators, with their identifiers as array keys and HTML contents as values...
disallowUserJs()
Do not allow scripts which can be modified by wiki users to load on this page; only allow scripts bun...
getOrigin()
Get this module's origin.
getUser()
Get the User object.
getVaryHeader()
Return a Vary: header on which to vary caches.
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
getModules($filter=false, $position=null, $param= 'mModules')
Get the list of modules to include on this page.
if(is_null($wgLocalTZoffset)) if(!$wgDBerrorLogTZ) $wgRequest
Show an error when the user hits a rate limit.
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
addModuleStyles($modules)
Add only CSS of one or more modules recognized by ResourceLoader.
addModuleScripts($modules)
Add only JS of one or more modules recognized by ResourceLoader.
setCanonicalUrl($url)
Set the URL to be used for the <link rel="canonical">.
setLastModified($timestamp)
Override the last modified timestamp.
setSyndicated($show=true)
Add or remove feed links in the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version.
getRevisionTimestamp()
Get the timestamp of displayed revision.
getLinkTags()
Returns the current <link> tags.
isArticle()
Return whether the content displayed page is related to the source of the corresponding article on th...
Object passed around to modules which contains information about the state of a specific loader reque...
ParserOptions $mParserOptions
lazy initialised, use parserOptions()
addJsConfigVars($keys, $value=null)
Add one or more variables to be set in mw.config in JavaScript.
Allows to change the fields on the form that will be generated $name
getSkin()
Get the Skin object.
static formatRobotPolicy($policy)
Converts a String robot policy into an associative array, to allow merging of several policies using ...