58 parent::__construct(
'Version' );
59 $this->parser = $parser;
72 $credits[$credit[
'type']][] = $credit;
83 $config = $this->getConfig();
84 $credits = self::getCredits( ExtensionRegistry::getInstance(), $config );
87 $this->outputHeader();
88 $out = $this->getOutput();
89 $out->setPreventClickjacking(
false );
92 $parts = explode(
'/', (
string)$par );
94 if ( isset( $parts[1] ) ) {
95 $extName = str_replace(
'_',
' ', $parts[1] );
97 foreach ( $credits as $group => $extensions ) {
98 foreach ( $extensions as
$ext ) {
99 if ( isset(
$ext[
'name'] ) && (
$ext[
'name'] === $extName ) ) {
106 $out->setStatusCode( 404 );
109 $extName =
'MediaWiki';
113 switch ( strtolower( $parts[0] ) ) {
115 $out->addModuleStyles(
'mediawiki.special' );
117 $wikiText =
'{{int:version-credits-not-found}}';
118 if ( $extName ===
'MediaWiki' ) {
119 $wikiText = file_get_contents(
$IP .
'/CREDITS' );
121 $wikiText = str_replace(
122 [
'<!-- BEGIN CONTRIBUTOR LIST -->',
'<!-- END CONTRIBUTOR LIST -->' ],
123 [
'<div class="mw-version-credits">',
'</div>' ],
125 } elseif ( ( $extNode !==
null ) && isset( $extNode[
'path'] ) ) {
126 $file = ExtensionInfo::getAuthorsFileName( dirname( $extNode[
'path'] ) );
128 $wikiText = file_get_contents(
$file );
129 if ( substr(
$file, -4 ) ===
'.txt' ) {
130 $wikiText = Html::element(
142 $out->setPageTitle( $this->msg(
'version-credits-title', $extName ) );
143 $out->addWikiTextAsInterface( $wikiText );
147 $out->setPageTitle( $this->msg(
'version-license-title', $extName ) );
149 $licenseFound =
false;
151 if ( $extName ===
'MediaWiki' ) {
152 $out->addWikiTextAsInterface(
153 file_get_contents(
$IP .
'/COPYING' )
155 $licenseFound =
true;
156 } elseif ( ( $extNode !==
null ) && isset( $extNode[
'path'] ) ) {
157 $files = ExtensionInfo::getLicenseFileNames( dirname( $extNode[
'path'] ) );
159 if ( count( $files ) ) {
160 $licenseFound =
true;
161 foreach ( $files as
$file ) {
162 $out->addWikiTextAsInterface(
169 file_get_contents(
$file )
175 if ( !$licenseFound ) {
176 $out->addWikiTextAsInterface(
'{{int:version-license-not-found}}' );
180 $out->addModuleStyles(
'mediawiki.special' );
181 $out->addWikiTextAsInterface(
182 self::getMediaWikiCredits() .
183 self::softwareInformation() .
184 $this->getEntryPointInfo()
187 $this->getSkinCredits( $credits ) .
188 $this->getExtensionCredits( $credits ) .
189 $this->getExternalLibraries( $credits ) .
190 $this->getParserTags() .
191 $this->getParserFunctionHooks()
193 $out->addWikiTextAsInterface( $this->getHooks() );
194 $out->addHTML( $this->IPInfo() );
205 private static function getMediaWikiCredits() {
208 [
'id' =>
'mw-version-license' ],
213 $ret .=
'<div class="plainlinks">';
215 " . self::getCopyrightAndAuthorList() .
"\n
216 " .
'<div class="mw-version-license-info">' .
217 wfMessage(
'version-license-info' )->text() .
221 return str_replace(
"\t\t",
'', $ret ) .
"\n";
232 if ( defined(
'MEDIAWIKI_INSTALL' ) ) {
233 $othersLink =
'[https://www.mediawiki.org/wiki/Special:Version/Credits ' .
234 wfMessage(
'version-poweredby-others' )->text() .
']';
236 $othersLink =
'[[Special:Version/Credits|' .
237 wfMessage(
'version-poweredby-others' )->text() .
']]';
240 $translatorsLink =
'[https://translatewiki.net/wiki/Translating:MediaWiki/Credits ' .
241 wfMessage(
'version-poweredby-translators' )->text() .
']';
244 'Magnus Manske',
'Brion Vibber',
'Lee Daniel Crocker',
245 'Tim Starling',
'Erik Möller',
'Gabriel Wicke',
'Ævar Arnfjörð Bjarmason',
246 'Niklas Laxström',
'Domas Mituzas',
'Rob Church',
'Yuri Astrakhan',
247 'Aryeh Gregor',
'Aaron Schulz',
'Andrew Garrett',
'Raimond Spekking',
248 'Alexandre Emsenhuber',
'Siebrand Mazeland',
'Chad Horohoe',
249 'Roan Kattouw',
'Trevor Parscal',
'Bryan Tong Minh',
'Sam Reed',
250 'Victor Vasiliev',
'Rotem Liss',
'Platonides',
'Antoine Musso',
251 'Timo Tijhof',
'Daniel Kinzler',
'Jeroen De Dauw',
'Brad Jorsch',
252 'Bartosz Dziewoński',
'Ed Sanders',
'Moriel Schottlender',
253 'Kunal Mehta',
'James D. Forrester',
'Brian Wolff',
'Adam Shorland',
254 'DannyS712',
'Ori Livneh',
255 $othersLink, $translatorsLink
258 return wfMessage(
'version-poweredby-credits', MWTimestamp::getLocalInstance()->format(
'Y' ),
259 $wgLang->listToText( $authorList ) )->text();
267 private static function getSoftwareInformation() {
274 '[https://www.mediawiki.org/ MediaWiki]' => self::getVersionLinked(),
275 '[https://php.net/ PHP]' => PHP_VERSION .
" (" . PHP_SAPI .
")",
276 $dbr->getSoftwareLink() =>
$dbr->getServerInfo(),
279 if ( defined(
'INTL_ICU_VERSION' ) ) {
280 $software[
'[https://icu.unicode.org/ ICU]'] = INTL_ICU_VERSION;
294 private static function softwareInformation() {
297 [
'id' =>
'mw-version-software' ],
300 Xml::openElement(
'table', [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-software' ] ) .
302 <th>" .
wfMessage(
'version-software-product' )->text() .
"</th>
303 <th>" .
wfMessage(
'version-software-version' )->text() .
"</th>
306 foreach ( self::getSoftwareInformation() as $name => $version ) {
308 <td>" . $name .
"</td>
309 <td dir=\"ltr\">" . $version .
"</td>
327 $gitInfo = self::getGitHeadSha1(
$IP );
330 } elseif ( $flags ===
'nodb' ) {
331 $shortSha1 = substr( $gitInfo, 0, 7 );
334 $shortSha1 = substr( $gitInfo, 0, 7 );
336 if (
$lang !==
null ) {
337 $msg->inLanguage(
$lang );
339 $shortSha1 = $msg->params( $shortSha1 )->escaped();
354 $gitVersion = self::getVersionLinkedGit();
367 private static function getMWVersionLinked() {
369 if ( Hooks::runner()->onSpecialVersionVersionUrl(
MW_VERSION, $versionUrl ) ) {
371 preg_match(
"/^(\d+\.\d+)/",
MW_VERSION, $versionParts );
372 $versionUrl =
"https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}";
375 return '[' . $versionUrl .
' ' .
MW_VERSION .
']';
383 private static function getVersionLinkedGit() {
387 $headSHA1 = $gitInfo->getHeadSHA1();
392 $shortSHA1 =
'(' . substr( $headSHA1, 0, 7 ) .
')';
394 $gitHeadUrl = $gitInfo->getHeadViewUrl();
395 if ( $gitHeadUrl !==
false ) {
396 $shortSHA1 =
"[$gitHeadUrl $shortSHA1]";
399 $gitHeadCommitDate = $gitInfo->getHeadCommitDate();
400 if ( $gitHeadCommitDate ) {
404 return self::getMWVersionLinked() .
" $shortSHA1";
417 if ( self::$extensionTypes === false ) {
418 self::$extensionTypes = [
419 'specialpage' =>
wfMessage(
'version-specialpages' )->text(),
420 'editor' =>
wfMessage(
'version-editors' )->text(),
421 'parserhook' =>
wfMessage(
'version-parserhooks' )->text(),
422 'variable' =>
wfMessage(
'version-variables' )->text(),
423 'media' =>
wfMessage(
'version-mediahandlers' )->text(),
424 'antispam' =>
wfMessage(
'version-antispam' )->text(),
425 'skin' =>
wfMessage(
'version-skins' )->text(),
426 'api' =>
wfMessage(
'version-api' )->text(),
427 'other' =>
wfMessage(
'version-other' )->text(),
430 Hooks::runner()->onExtensionTypes( self::$extensionTypes );
433 return self::$extensionTypes;
446 $types = self::getExtensionTypes();
448 return $types[
$type] ?? $types[
'other'];
457 private function getExtensionCredits( array $credits ) {
461 ( count( $credits ) === 1 && isset( $credits[
'skin'] ) )
466 $extensionTypes = self::getExtensionTypes();
470 [
'id' =>
'mw-version-ext' ],
471 $this->msg(
'version-extensions' )->text()
473 Xml::openElement(
'table', [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-ext' ] );
476 if ( !array_key_exists(
'other', $credits ) ) {
477 $credits[
'other'] = [];
481 foreach ( $credits as
$type => $extensions ) {
482 if ( !array_key_exists(
$type, $extensionTypes ) ) {
483 $credits[
'other'] = array_merge( $credits[
'other'], $extensions );
487 $this->firstExtOpened =
false;
489 foreach ( $extensionTypes as
$type => $text ) {
491 if (
$type !==
'other' &&
$type !==
'skin' ) {
492 $out .= $this->getExtensionCategory(
$type, $text, $credits[
$type] ?? [] );
497 $out .= $this->getExtensionCategory(
'other', $extensionTypes[
'other'], $credits[
'other'] );
510 private function getSkinCredits( array $credits ) {
511 if ( !isset( $credits[
'skin'] ) || count( $credits[
'skin'] ) === 0 ) {
517 [
'id' =>
'mw-version-skin' ],
518 $this->msg(
'version-skins' )->text()
520 Xml::openElement(
'table', [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-skin' ] );
522 $this->firstExtOpened =
false;
523 $out .= $this->getExtensionCategory(
'skin',
null, $credits[
'skin'] );
539 "$IP/vendor/composer/installed.json"
542 $extensionTypes = self::getExtensionTypes();
543 foreach ( $extensionTypes as
$type => $message ) {
544 if ( !isset( $credits[
$type] ) || $credits[
$type] === [] ) {
547 foreach ( $credits[
$type] as $extension ) {
548 if ( !isset( $extension[
'path'] ) ) {
551 $paths[] = dirname( $extension[
'path'] ) .
'/vendor/composer/installed.json';
557 foreach ( $paths as
$path ) {
558 if ( !file_exists(
$path ) ) {
564 $dependencies += $installed->getInstalledDependencies();
567 if ( $dependencies === [] ) {
571 ksort( $dependencies );
573 $out = Html::element(
575 [
'id' =>
'mw-version-libraries' ],
576 $this->msg(
'version-libraries' )->text()
578 $out .= Html::openElement(
580 [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-libraries' ]
582 $out .= Html::openElement(
'tr' )
583 . Html::element(
'th', [], $this->msg(
'version-libraries-library' )->text() )
584 . Html::element(
'th', [], $this->msg(
'version-libraries-version' )->text() )
585 . Html::element(
'th', [], $this->msg(
'version-libraries-license' )->text() )
586 . Html::element(
'th', [], $this->msg(
'version-libraries-description' )->text() )
587 . Html::element(
'th', [], $this->msg(
'version-libraries-authors' )->text() )
588 . Html::closeElement(
'tr' );
590 foreach ( $dependencies as $name => $info ) {
591 if ( !is_array( $info ) || strpos( $info[
'type'],
'mediawiki-' ) === 0 ) {
596 $authors = array_map(
static function ( $arr ) {
598 if ( isset( $arr[
'homepage'] ) ) {
599 return "[{$arr['homepage']} {$arr['name']}]";
602 }, $info[
'authors'] );
603 $authors = $this->listAuthors( $authors,
false,
"$IP/vendor/$name" );
608 $out .= Html::openElement(
'tr', [
611 'id' => Sanitizer::escapeIdForAttribute(
612 "mw-version-library-$name"
618 "https://packagist.org/packages/$name", $name,
620 [
'class' =>
'mw-version-library-name' ]
623 . Html::element(
'td', [
'dir' =>
'auto' ], $info[
'version'] )
625 . Html::element(
'td', [
'dir' =>
'auto' ], $this->listToText( $info[
'licenses'] ) )
626 . Html::element(
'td', [
'lang' =>
'en',
'dir' =>
'ltr' ], $info[
'description'] )
627 . Html::rawElement(
'td', [], $authors )
628 . Html::closeElement(
'tr' );
630 $out .= Html::closeElement(
'table' );
641 $tags = $this->parser->getTags();
643 if ( count( $tags ) ) {
644 $out = Html::rawElement(
647 'class' =>
'mw-headline plainlinks',
648 'id' =>
'mw-version-parser-extensiontags',
652 'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Tag_extensions',
653 $this->msg(
'version-parser-extensiontags' )->parse(),
658 array_walk( $tags,
static function ( &$value ) {
660 $value = Html::element(
664 'style' =>
'white-space: nowrap;',
670 $out .= $this->listToText( $tags );
684 $fhooks = $this->parser->getFunctionHooks();
685 if ( count( $fhooks ) ) {
686 $out = Html::rawElement(
689 'class' =>
'mw-headline plainlinks',
690 'id' =>
'mw-version-parser-function-hooks',
694 'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Parser_functions',
695 $this->msg(
'version-parser-function-hooks' )->parse(),
700 $out .= $this->listToText( $fhooks );
718 $config = $this->getConfig();
719 $credits = $config->get( MainConfigNames::ExtensionCredits );
723 if ( $creditsGroup ) {
724 $out .= $this->openExtType( $text,
'credits-' .
$type );
726 usort( $creditsGroup, [ $this,
'compare' ] );
728 foreach ( $creditsGroup as $extension ) {
729 $out .= $this->getCreditsForExtension(
$type, $extension );
743 return $this->getLanguage()->lc( $a[
'name'] ) <=> $this->getLanguage()->lc( $b[
'name'] );
765 $out = $this->getOutput();
769 if ( isset( $extension[
'namemsg'] ) ) {
771 $extensionName = $this->msg( $extension[
'namemsg'] )->text();
772 } elseif ( isset( $extension[
'name'] ) ) {
774 $extensionName = $extension[
'name'];
776 $extensionName = $this->msg(
'version-no-ext-name' )->text();
779 if ( isset( $extension[
'url'] ) ) {
785 [
'class' =>
'mw-version-ext-name' ]
788 $extensionNameLink = htmlspecialchars( $extensionName );
794 $canonicalVersion =
'–';
795 $extensionPath =
null;
800 if ( isset( $extension[
'version'] ) ) {
801 $canonicalVersion = $out->parseInlineAsInterface( $extension[
'version'] );
804 if ( isset( $extension[
'path'] ) ) {
806 $extensionPath = dirname( $extension[
'path'] );
807 if ( $this->coreId ==
'' ) {
808 wfDebug(
'Looking up core head id' );
809 $coreHeadSHA1 = self::getGitHeadSha1(
$IP );
810 if ( $coreHeadSHA1 ) {
811 $this->coreId = $coreHeadSHA1;
815 $memcKey =
$cache->makeKey(
816 'specialversion-ext-version-text', $extension[
'path'], $this->coreId
818 list( $vcsVersion, $vcsLink, $vcsDate ) =
$cache->get( $memcKey );
820 if ( !$vcsVersion ) {
821 wfDebug(
"Getting VCS info for extension {$extension['name']}" );
822 $gitInfo =
new GitInfo( $extensionPath );
823 $vcsVersion = $gitInfo->getHeadSHA1();
824 if ( $vcsVersion !==
false ) {
825 $vcsVersion = substr( $vcsVersion, 0, 7 );
826 $vcsLink = $gitInfo->getHeadViewUrl();
827 $vcsDate = $gitInfo->getHeadCommitDate();
829 $cache->set( $memcKey, [ $vcsVersion, $vcsLink, $vcsDate ], 60 * 60 * 24 );
831 wfDebug(
"Pulled VCS info for extension {$extension['name']} from cache" );
835 $versionString = Html::rawElement(
837 [
'class' =>
'mw-version-ext-version' ],
845 $this->msg(
'version-version', $vcsVersion )->text(),
848 [
'class' =>
'mw-version-ext-vcs-version' ]
851 $vcsVerString = Html::element(
'span',
852 [
'class' =>
'mw-version-ext-vcs-version' ],
856 $versionString .=
" {$vcsVerString}";
859 $versionString .=
' ' . Html::element(
'span', [
860 'class' =>
'mw-version-ext-vcs-timestamp',
861 'dir' => $this->getLanguage()->getDir(),
862 ], $this->getLanguage()->timeanddate( $vcsDate,
true ) );
864 $versionString = Html::rawElement(
'span',
865 [
'class' =>
'mw-version-ext-meta-version' ],
873 if ( isset( $extension[
'name'] ) ) {
875 if ( isset( $extension[
'license-name'] ) ) {
876 $licenseName =
new HtmlArmor( $out->parseInlineAsInterface( $extension[
'license-name'] ) );
877 } elseif ( $extensionPath !==
null && ExtensionInfo::getLicenseFileNames( $extensionPath ) ) {
878 $licenseName = $this->msg(
'version-ext-license' )->text();
880 if ( $licenseName !==
null ) {
881 $licenseLink = $this->getLinkRenderer()->makeLink(
882 $this->getPageTitle(
'License/' . $extension[
'name'] ),
885 'class' =>
'mw-version-ext-license',
895 if ( isset( $extension[
'descriptionmsg'] ) ) {
897 $descriptionMsg = $extension[
'descriptionmsg'];
899 if ( is_array( $descriptionMsg ) ) {
900 $descriptionMsgKey = array_shift( $descriptionMsg );
901 $descriptionMsg = array_map(
'htmlspecialchars', $descriptionMsg );
902 $description = $this->msg( $descriptionMsgKey, ...$descriptionMsg )->text();
904 $description = $this->msg( $descriptionMsg )->text();
906 } elseif ( isset( $extension[
'description'] ) ) {
908 $description = $extension[
'description'];
912 $description = $out->parseInlineAsInterface( $description );
915 $authors = $extension[
'author'] ?? [];
917 $authors = $this->listAuthors( $authors, $extension[
'name'], $extensionPath );
920 $html = Html::openElement(
'tr', [
921 'class' =>
'mw-version-ext',
922 'id' => Sanitizer::escapeIdForAttribute(
'mw-version-ext-' .
$type .
'-' . $extension[
'name'] )
926 $html .= Html::rawElement(
'td', [], $extensionNameLink );
927 $html .= Html::rawElement(
'td', [], $versionString );
928 $html .= Html::rawElement(
'td', [], $licenseLink );
929 $html .= Html::rawElement(
'td', [
'class' =>
'mw-version-ext-description' ], $description );
930 $html .= Html::rawElement(
'td', [
'class' =>
'mw-version-ext-authors' ], $authors );
932 $html .= Html::closeElement(
'tr' );
942 private function getHooks() {
943 if ( $this->getConfig()->
get( MainConfigNames::SpecialVersionShowHooks ) &&
944 count( $this->getConfig()->
get( MainConfigNames::Hooks ) ) ) {
945 $myHooks = $this->getConfig()->get( MainConfigNames::Hooks );
949 $ret[] =
'== {{int:version-hooks}} ==';
950 $ret[] = Html::openElement(
'table', [
'class' =>
'wikitable',
'id' =>
'sv-hooks' ] );
951 $ret[] = Html::openElement(
'tr' );
952 $ret[] = Html::element(
'th', [], $this->msg(
'version-hook-name' )->text() );
953 $ret[] = Html::element(
'th', [], $this->msg(
'version-hook-subscribedby' )->text() );
954 $ret[] = Html::closeElement(
'tr' );
956 foreach ( $myHooks as $hook => $hooks ) {
957 $ret[] = Html::openElement(
'tr' );
958 $ret[] = Html::element(
'td', [], $hook );
960 $ret[] = Html::element(
'td', [], $this->listToText( $hooks ) );
961 $ret[] = Html::closeElement(
'tr' );
966 return implode(
"\n", $ret );
972 private function openExtType(
string $text =
null,
string $name =
null ) {
975 $opt = [
'colspan' => 5 ];
976 if ( $this->firstExtOpened ) {
979 Html::element(
'td', $opt )
982 $this->firstExtOpened =
true;
985 $opt[
'id'] =
"sv-$name";
988 if ( $text !==
null ) {
990 Html::element(
'th', $opt, $text )
994 $firstHeadingMsg = ( $name ===
'credits-skin' )
995 ?
'version-skin-colheader-name'
996 :
'version-ext-colheader-name';
998 $out .=
Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
999 $this->msg( $firstHeadingMsg )->text() );
1000 $out .=
Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1001 $this->msg(
'version-ext-colheader-version' )->text() );
1002 $out .=
Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1003 $this->msg(
'version-ext-colheader-license' )->text() );
1004 $out .=
Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1005 $this->msg(
'version-ext-colheader-description' )->text() );
1006 $out .=
Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1007 $this->msg(
'version-ext-colheader-credits' )->text() );
1018 private function IPInfo() {
1019 $ip = str_replace(
'--',
' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
1021 return "<!-- visited from $ip -->\n<span style='display:none'>visited from $ip</span>";
1047 $linkRenderer = $this->getLinkRenderer();
1050 $authors = (array)$authors;
1055 if ( count( $authors ) === 1 && $authors[0] ===
'...' ) {
1058 if ( $extName && ExtensionInfo::getAuthorsFileName( $extDir ) ) {
1059 return $linkRenderer->makeLink(
1060 $this->getPageTitle(
"Credits/$extName" ),
1061 $this->msg(
'version-poweredby-various' )->text()
1064 return $this->msg(
'version-poweredby-various' )->escaped();
1070 foreach ( $authors as $item ) {
1071 if ( $item ==
'...' ) {
1074 if ( $extName && ExtensionInfo::getAuthorsFileName( $extDir ) ) {
1075 $text = $linkRenderer->makeLink(
1076 $this->getPageTitle(
"Credits/$extName" ),
1077 $this->msg(
'version-poweredby-others' )->text()
1080 $text = $this->msg(
'version-poweredby-others' )->escaped();
1083 } elseif ( substr( $item, -5 ) ==
' ...]' ) {
1085 $list[] = $this->getOutput()->parseInlineAsInterface(
1086 substr( $item, 0, -4 ) . $this->msg(
'version-poweredby-others' )->text() .
"]"
1089 $list[] = $this->getOutput()->parseInlineAsInterface( $item );
1093 if ( $extName && !$hasOthers && ExtensionInfo::getAuthorsFileName( $extDir ) ) {
1094 $list[] = $linkRenderer->makeLink(
1095 $this->getPageTitle(
"Credits/$extName" ),
1096 $this->msg(
'version-poweredby-others' )->text()
1100 return $this->listToText( $list,
false );
1112 if ( !count( $list ) ) {
1119 return $this->getLanguage()
1120 ->listToText( array_map( [ __CLASS__,
'arrayToString' ], $list ) );
1132 if ( is_array( $list ) && count( $list ) == 1 ) {
1135 if ( $list instanceof Closure ) {
1138 } elseif ( is_object( $list ) ) {
1139 $class =
wfMessage(
'parentheses' )->params( get_class( $list ) )->escaped();
1142 } elseif ( !is_array( $list ) ) {
1145 if ( is_object( $list[0] ) ) {
1146 $class = get_class( $list[0] );
1151 return wfMessage(
'parentheses' )->params(
"$class, {$list[1]}" )->escaped();
1162 return $repo->getHeadSHA1();
1171 return $repo->getCurrentBranch();
1179 $config = $this->getConfig();
1180 $scriptPath = $config->get( MainConfigNames::ScriptPath ) ?:
'/';
1183 'version-entrypoints-articlepath' => $config->get( MainConfigNames::ArticlePath ),
1184 'version-entrypoints-scriptpath' => $scriptPath,
1185 'version-entrypoints-index-php' =>
wfScript(
'index' ),
1186 'version-entrypoints-api-php' =>
wfScript(
'api' ),
1187 'version-entrypoints-rest-php' =>
wfScript(
'rest' ),
1190 $language = $this->getLanguage();
1192 'dir' => $language->getDir(),
1193 'lang' => $language->getHtmlCode()
1195 $out = Html::element(
1197 [
'id' =>
'mw-version-entrypoints' ],
1198 $this->msg(
'version-entrypoints' )->text()
1200 Html::openElement(
'table',
1202 'class' =>
'wikitable plainlinks',
1203 'id' =>
'mw-version-entrypoints-table',
1208 Html::openElement(
'tr' ) .
1212 $this->msg(
'version-entrypoints-header-entrypoint' )->text()
1217 $this->msg(
'version-entrypoints-header-url' )->text()
1219 Html::closeElement(
'tr' );
1221 foreach ( $entryPoints as $message => $value ) {
1223 $out .= Html::openElement(
'tr' ) .
1226 Html::rawElement(
'td', [], $this->msg( $message )->plain() ) .
1227 Html::rawElement(
'td', [], Html::rawElement(
'code', [],
"[$url $value]" ) ) .
1228 Html::closeElement(
'tr' );
1231 $out .= Html::closeElement(
'table' );
const MW_VERSION
The running version of MediaWiki.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
if(!defined( 'MEDIAWIKI')) if(ini_get('mbstring.func_overload')) if(!defined( 'MW_ENTRY_POINT')) global $IP
Environment checks.
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode $wgLang
if(!defined('MW_SETUP_CALLBACK'))
The persistent session ID (if any) loaded at startup.
Reads an installed.json file and provides accessors to get what is installed.
The Registry loads JSON files, and uses a Processor to extract information from them.
getAllThings()
Get credits information about all installed extensions and skins.
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
Marks HTML that shouldn't be escaped.
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static closeElement( $element)
Returns "</$element>".
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
A class containing constants representing the names of configuration variables.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Parent class for all special pages.
Give information about the version of MediaWiki, PHP, the DB and extensions.
static getVersionLinked()
Return a wikitext-formatted string of the MediaWiki version with a link to the Git SHA1 of head if av...
static getExtensionTypeName( $type)
Returns the internationalized name for an extension type.
static getGitHeadSha1( $dir)
__construct(Parser $parser)
getParserFunctionHooks()
Obtains a list of installed parser function hooks and the associated H2 header.
getExternalLibraries(array $credits)
Generate an HTML table for external libraries that are installed.
listToText( $list, $sort=true)
Convert an array of items into a list for display.
getEntryPointInfo()
Get the list of entry points and their URLs.
static getCredits(ExtensionRegistry $reg, Config $conf)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
listAuthors( $authors, $extName, $extDir)
Return a formatted unsorted list of authors.
string $coreId
The current rev id/SHA hash of MediaWiki core.
static getExtensionTypes()
Returns an array with the base extension types.
getCreditsForExtension( $type, array $extension)
Creates and formats a version line for a single extension.
getParserTags()
Obtains a list of installed parser tags and the associated H2 header.
compare( $a, $b)
Callback to sort extensions by type.
static getVersion( $flags='', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
static getCopyrightAndAuthorList()
Get the "MediaWiki is copyright 2001-20xx by lots of cool folks" text.
static getGitCurrentBranch( $dir)
static string[] false $extensionTypes
Lazy initialized key/value with message content.
static arrayToString( $list)
Convert an array or object to a string for display.
getExtensionCategory( $type, ?string $text, array $creditsGroup)
Creates and returns the HTML for a single extension category.
static closeElement( $element)
Shortcut to close an XML element.
static openElement( $element, $attribs=null)
This opens an XML element.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Interface for configuration instances.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
if(!is_readable( $file)) $ext
if(!isset( $args[0])) $lang