57 parent::__construct(
'Version' );
69 $credits = $conf->get(
'ExtensionCredits' );
71 $credits[$credit[
'type']][] = $credit;
82 $config = $this->getConfig();
83 $credits = self::getCredits( ExtensionRegistry::getInstance(), $config );
86 $this->outputHeader();
87 $out = $this->getOutput();
88 $out->allowClickjacking();
91 $parts = explode(
'/', (
string)$par );
93 if ( isset( $parts[1] ) ) {
94 $extName = str_replace(
'_',
' ', $parts[1] );
96 foreach ( $credits as $group => $extensions ) {
97 foreach ( $extensions as
$ext ) {
98 if ( isset(
$ext[
'name'] ) && (
$ext[
'name'] === $extName ) ) {
105 $out->setStatusCode( 404 );
108 $extName =
'MediaWiki';
112 switch ( strtolower( $parts[0] ) ) {
114 $out->addModuleStyles(
'mediawiki.special.version' );
116 $wikiText =
'{{int:version-credits-not-found}}';
117 if ( $extName ===
'MediaWiki' ) {
118 $wikiText = file_get_contents(
$IP .
'/CREDITS' );
120 $wikiText = str_replace(
121 [
'<!-- BEGIN CONTRIBUTOR LIST -->',
'<!-- END CONTRIBUTOR LIST -->' ],
122 [
'<div class="mw-version-credits">',
'</div>' ],
124 } elseif ( ( $extNode !==
null ) && isset( $extNode[
'path'] ) ) {
125 $file = ExtensionInfo::getAuthorsFileName( dirname( $extNode[
'path'] ) );
127 $wikiText = file_get_contents(
$file );
128 if ( substr(
$file, -4 ) ===
'.txt' ) {
129 $wikiText = Html::element(
141 $out->setPageTitle( $this->msg(
'version-credits-title', $extName ) );
142 $out->addWikiTextAsInterface( $wikiText );
146 $out->setPageTitle( $this->msg(
'version-license-title', $extName ) );
148 $licenseFound =
false;
150 if ( $extName ===
'MediaWiki' ) {
151 $out->addWikiTextAsInterface(
152 file_get_contents(
$IP .
'/COPYING' )
154 $licenseFound =
true;
155 } elseif ( ( $extNode !==
null ) && isset( $extNode[
'path'] ) ) {
156 $files = ExtensionInfo::getLicenseFileNames( dirname( $extNode[
'path'] ) );
158 if ( count( $files ) ) {
159 $licenseFound =
true;
160 foreach ( $files as
$file ) {
161 $out->addWikiTextAsInterface(
168 file_get_contents(
$file )
174 if ( !$licenseFound ) {
175 $out->addWikiTextAsInterface(
'{{int:version-license-not-found}}' );
179 $out->addModuleStyles(
'mediawiki.special.version' );
180 $out->addWikiTextAsInterface(
181 self::getMediaWikiCredits() .
182 self::softwareInformation() .
183 $this->getEntryPointInfo()
186 $this->getSkinCredits( $credits ) .
187 $this->getExtensionCredits( $credits ) .
188 $this->getExternalLibraries( $credits ) .
189 $this->getParserTags() .
190 $this->getParserFunctionHooks()
192 $out->addWikiTextAsInterface( $this->getWgHooks() );
193 $out->addHTML( $this->IPInfo() );
207 [
'id' =>
'mw-version-license' ],
212 $ret .=
'<div class="plainlinks">';
214 " . self::getCopyrightAndAuthorList() .
"\n
215 " .
'<div class="mw-version-license-info">' .
216 wfMessage(
'version-license-info' )->text() .
220 return str_replace(
"\t\t",
'', $ret ) .
"\n";
231 if ( defined(
'MEDIAWIKI_INSTALL' ) ) {
232 $othersLink =
'[https://www.mediawiki.org/wiki/Special:Version/Credits ' .
233 wfMessage(
'version-poweredby-others' )->text() .
']';
235 $othersLink =
'[[Special:Version/Credits|' .
236 wfMessage(
'version-poweredby-others' )->text() .
']]';
239 $translatorsLink =
'[https://translatewiki.net/wiki/Translating:MediaWiki/Credits ' .
240 wfMessage(
'version-poweredby-translators' )->text() .
']';
243 'Magnus Manske',
'Brion Vibber',
'Lee Daniel Crocker',
244 'Tim Starling',
'Erik Möller',
'Gabriel Wicke',
'Ævar Arnfjörð Bjarmason',
245 'Niklas Laxström',
'Domas Mituzas',
'Rob Church',
'Yuri Astrakhan',
246 'Aryeh Gregor',
'Aaron Schulz',
'Andrew Garrett',
'Raimond Spekking',
247 'Alexandre Emsenhuber',
'Siebrand Mazeland',
'Chad Horohoe',
248 'Roan Kattouw',
'Trevor Parscal',
'Bryan Tong Minh',
'Sam Reed',
249 'Victor Vasiliev',
'Rotem Liss',
'Platonides',
'Antoine Musso',
250 'Timo Tijhof',
'Daniel Kinzler',
'Jeroen De Dauw',
'Brad Jorsch',
251 'Bartosz Dziewoński',
'Ed Sanders',
'Moriel Schottlender',
252 'Kunal Mehta',
'James D. Forrester',
'Brian Wolff',
'Adam Shorland',
253 'DannyS712',
'Ori Livneh',
254 $othersLink, $translatorsLink
257 return wfMessage(
'version-poweredby-credits', MWTimestamp::getLocalInstance()->format(
'Y' ),
258 $wgLang->listToText( $authorList ) )->text();
273 '[https://www.mediawiki.org/ MediaWiki]' => self::getVersionLinked(),
274 '[https://php.net/ PHP]' => PHP_VERSION .
" (" . PHP_SAPI .
")",
275 $dbr->getSoftwareLink() =>
$dbr->getServerInfo(),
278 if ( defined(
'INTL_ICU_VERSION' ) ) {
279 $software[
'[http://site.icu-project.org/ ICU]'] = INTL_ICU_VERSION;
283 Hooks::runner()->onSoftwareInfo( $software );
296 [
'id' =>
'mw-version-software' ],
299 Xml::openElement(
'table', [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-software' ] ) .
301 <th>" .
wfMessage(
'version-software-product' )->text() .
"</th>
302 <th>" .
wfMessage(
'version-software-version' )->text() .
"</th>
305 foreach ( self::getSoftwareInformation() as $name => $version ) {
307 <td>" . $name .
"</td>
308 <td dir=\"ltr\">" . $version .
"</td>
312 return $out . Xml::closeElement(
'table' );
325 $gitInfo = self::getGitHeadSha1(
$IP );
328 } elseif ( $flags ===
'nodb' ) {
329 $shortSha1 = substr( $gitInfo, 0, 7 );
332 $shortSha1 = substr( $gitInfo, 0, 7 );
334 if (
$lang !==
null ) {
335 $msg->inLanguage(
$lang );
337 $shortSha1 = $msg->params( $shortSha1 )->escaped();
352 $gitVersion = self::getVersionLinkedGit();
367 if ( Hooks::runner()->onSpecialVersionVersionUrl(
MW_VERSION, $versionUrl ) ) {
369 preg_match(
"/^(\d+\.\d+)/",
MW_VERSION, $versionParts );
370 $versionUrl =
"https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}";
373 return '[' . $versionUrl .
' ' .
MW_VERSION .
']';
385 $headSHA1 = $gitInfo->getHeadSHA1();
390 $shortSHA1 =
'(' . substr( $headSHA1, 0, 7 ) .
')';
392 $gitHeadUrl = $gitInfo->getHeadViewUrl();
393 if ( $gitHeadUrl !==
false ) {
394 $shortSHA1 =
"[$gitHeadUrl $shortSHA1]";
397 $gitHeadCommitDate = $gitInfo->getHeadCommitDate();
398 if ( $gitHeadCommitDate ) {
399 $shortSHA1 .= Html::element(
'br' ) .
$wgLang->timeanddate( $gitHeadCommitDate,
true );
402 return self::getMWVersionLinked() .
" $shortSHA1";
416 if ( self::$extensionTypes ===
false ) {
417 self::$extensionTypes = [
418 'specialpage' =>
wfMessage(
'version-specialpages' )->text(),
419 'editor' =>
wfMessage(
'version-editors' )->text(),
420 'parserhook' =>
wfMessage(
'version-parserhooks' )->text(),
421 'variable' =>
wfMessage(
'version-variables' )->text(),
422 'media' =>
wfMessage(
'version-mediahandlers' )->text(),
423 'antispam' =>
wfMessage(
'version-antispam' )->text(),
424 'skin' =>
wfMessage(
'version-skins' )->text(),
425 'api' =>
wfMessage(
'version-api' )->text(),
426 'other' =>
wfMessage(
'version-other' )->text(),
429 Hooks::runner()->onExtensionTypes( self::$extensionTypes );
432 return self::$extensionTypes;
445 $types = self::getExtensionTypes();
447 return $types[
$type] ?? $types[
'other'];
460 ( count( $credits ) === 1 && isset( $credits[
'skin'] ) )
465 $extensionTypes = self::getExtensionTypes();
469 [
'id' =>
'mw-version-ext' ],
470 $this->msg(
'version-extensions' )->text()
472 Xml::openElement(
'table', [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-ext' ] );
475 if ( !array_key_exists(
'other', $credits ) ) {
476 $credits[
'other'] = [];
480 foreach ( $credits as
$type => $extensions ) {
481 if ( !array_key_exists(
$type, $extensionTypes ) ) {
482 $credits[
'other'] = array_merge( $credits[
'other'], $extensions );
486 $this->firstExtOpened =
false;
488 foreach ( $extensionTypes as
$type => $message ) {
490 if (
$type !==
'other' &&
$type !==
'skin' ) {
491 $out .= $this->getExtensionCategory(
$type, $message, $credits[
$type] ?? [] );
496 $out .= $this->getExtensionCategory(
'other', $extensionTypes[
'other'], $credits[
'other'] );
498 $out .= Xml::closeElement(
'table' );
510 if ( !isset( $credits[
'skin'] ) || count( $credits[
'skin'] ) === 0 ) {
516 [
'id' =>
'mw-version-skin' ],
517 $this->msg(
'version-skins' )->text()
519 Xml::openElement(
'table', [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-skin' ] );
521 $this->firstExtOpened =
false;
522 $out .= $this->getExtensionCategory(
'skin',
null, $credits[
'skin'] );
524 $out .= Xml::closeElement(
'table' );
538 "$IP/vendor/composer/installed.json"
541 $extensionTypes = self::getExtensionTypes();
542 foreach ( $extensionTypes as
$type => $message ) {
543 if ( !isset( $credits[
$type] ) || $credits[
$type] === [] ) {
546 foreach ( $credits[
$type] as $extension ) {
547 if ( !isset( $extension[
'path'] ) ) {
550 $paths[] = dirname( $extension[
'path'] ) .
'/vendor/composer/installed.json';
556 foreach ( $paths as
$path ) {
557 if ( !file_exists(
$path ) ) {
563 $dependencies += $installed->getInstalledDependencies();
566 if ( $dependencies === [] ) {
570 ksort( $dependencies );
572 $out = Html::element(
574 [
'id' =>
'mw-version-libraries' ],
575 $this->msg(
'version-libraries' )->text()
577 $out .= Html::openElement(
579 [
'class' =>
'wikitable plainlinks',
'id' =>
'sv-libraries' ]
581 $out .= Html::openElement(
'tr' )
582 . Html::element(
'th', [], $this->msg(
'version-libraries-library' )->text() )
583 . Html::element(
'th', [], $this->msg(
'version-libraries-version' )->text() )
584 . Html::element(
'th', [], $this->msg(
'version-libraries-license' )->text() )
585 . Html::element(
'th', [], $this->msg(
'version-libraries-description' )->text() )
586 . Html::element(
'th', [], $this->msg(
'version-libraries-authors' )->text() )
587 . Html::closeElement(
'tr' );
589 foreach ( $dependencies as $name => $info ) {
590 if ( !is_array( $info ) || strpos( $info[
'type'],
'mediawiki-' ) === 0 ) {
595 $authors = array_map(
static function ( $arr ) {
597 if ( isset( $arr[
'homepage'] ) ) {
598 return "[{$arr['homepage']} {$arr['name']}]";
601 }, $info[
'authors'] );
602 $authors = $this->listAuthors( $authors,
false,
"$IP/vendor/$name" );
607 $out .= Html::openElement(
'tr', [
610 'id' => Sanitizer::escapeIdForAttribute(
611 "mw-version-library-$name"
617 "https://packagist.org/packages/$name", $name,
619 [
'class' =>
'mw-version-library-name' ]
622 . Html::element(
'td', [
'dir' =>
'auto' ], $info[
'version'] )
624 . Html::element(
'td', [
'dir' =>
'auto' ], $this->listToText( $info[
'licenses'] ) )
625 . Html::element(
'td', [
'lang' =>
'en',
'dir' =>
'ltr' ], $info[
'description'] )
626 . Html::rawElement(
'td', [], $authors )
627 . Html::closeElement(
'tr' );
629 $out .= Html::closeElement(
'table' );
640 $tags = $this->parser->getTags();
642 if ( count( $tags ) ) {
643 $out = Html::rawElement(
646 'class' =>
'mw-headline plainlinks',
647 'id' =>
'mw-version-parser-extensiontags',
651 'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Tag_extensions',
652 $this->msg(
'version-parser-extensiontags' )->parse(),
657 array_walk( $tags,
static function ( &$value ) {
659 $value = Html::element(
663 'style' =>
'white-space: nowrap;',
669 $out .= $this->listToText( $tags );
683 $fhooks = $this->parser->getFunctionHooks();
684 if ( count( $fhooks ) ) {
685 $out = Html::rawElement(
688 'class' =>
'mw-headline plainlinks',
689 'id' =>
'mw-version-parser-function-hooks',
693 'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Parser_functions',
694 $this->msg(
'version-parser-function-hooks' )->parse(),
699 $out .= $this->listToText( $fhooks );
717 $config = $this->getConfig();
718 $credits = $config->get(
'ExtensionCredits' );
722 if ( $creditsGroup ) {
723 $out .= $this->openExtType( $message,
'credits-' .
$type );
725 usort( $creditsGroup, [ $this,
'compare' ] );
727 foreach ( $creditsGroup as $extension ) {
728 $out .= $this->getCreditsForExtension(
$type, $extension );
742 return $this->getLanguage()->lc( $a[
'name'] ) <=> $this->getLanguage()->lc( $b[
'name'] );
764 $out = $this->getOutput();
768 if ( isset( $extension[
'namemsg'] ) ) {
770 $extensionName = $this->msg( $extension[
'namemsg'] )->text();
771 } elseif ( isset( $extension[
'name'] ) ) {
773 $extensionName = $extension[
'name'];
775 $extensionName = $this->msg(
'version-no-ext-name' )->text();
778 if ( isset( $extension[
'url'] ) ) {
784 [
'class' =>
'mw-version-ext-name' ]
787 $extensionNameLink = htmlspecialchars( $extensionName );
793 $canonicalVersion =
'–';
794 $extensionPath =
null;
799 if ( isset( $extension[
'version'] ) ) {
800 $canonicalVersion = $out->parseInlineAsInterface( $extension[
'version'] );
803 if ( isset( $extension[
'path'] ) ) {
805 $extensionPath = dirname( $extension[
'path'] );
806 if ( $this->coreId ==
'' ) {
807 wfDebug(
'Looking up core head id' );
808 $coreHeadSHA1 = self::getGitHeadSha1(
$IP );
809 if ( $coreHeadSHA1 ) {
810 $this->coreId = $coreHeadSHA1;
814 $memcKey =
$cache->makeKey(
815 'specialversion-ext-version-text', $extension[
'path'], $this->coreId
817 list( $vcsVersion, $vcsLink, $vcsDate ) =
$cache->get( $memcKey );
819 if ( !$vcsVersion ) {
820 wfDebug(
"Getting VCS info for extension {$extension['name']}" );
821 $gitInfo =
new GitInfo( $extensionPath );
822 $vcsVersion = $gitInfo->getHeadSHA1();
823 if ( $vcsVersion !==
false ) {
824 $vcsVersion = substr( $vcsVersion, 0, 7 );
825 $vcsLink = $gitInfo->getHeadViewUrl();
826 $vcsDate = $gitInfo->getHeadCommitDate();
828 $cache->set( $memcKey, [ $vcsVersion, $vcsLink, $vcsDate ], 60 * 60 * 24 );
830 wfDebug(
"Pulled VCS info for extension {$extension['name']} from cache" );
834 $versionString = Html::rawElement(
836 [
'class' =>
'mw-version-ext-version' ],
844 $this->msg(
'version-version', $vcsVersion )->text(),
847 [
'class' =>
'mw-version-ext-vcs-version' ]
850 $vcsVerString = Html::element(
'span',
851 [
'class' =>
'mw-version-ext-vcs-version' ],
855 $versionString .=
" {$vcsVerString}";
858 $versionString .=
' ' . Html::element(
'span', [
859 'class' =>
'mw-version-ext-vcs-timestamp',
860 'dir' => $this->getLanguage()->getDir(),
861 ], $this->getLanguage()->timeanddate( $vcsDate,
true ) );
863 $versionString = Html::rawElement(
'span',
864 [
'class' =>
'mw-version-ext-meta-version' ],
872 if ( isset( $extension[
'name'] ) ) {
874 if ( isset( $extension[
'license-name'] ) ) {
875 $licenseName =
new HtmlArmor( $out->parseInlineAsInterface( $extension[
'license-name'] ) );
876 } elseif ( ExtensionInfo::getLicenseFileNames( $extensionPath ) ) {
877 $licenseName = $this->msg(
'version-ext-license' )->text();
879 if ( $licenseName !==
null ) {
880 $licenseLink = $this->getLinkRenderer()->makeLink(
881 $this->getPageTitle(
'License/' . $extension[
'name'] ),
884 'class' =>
'mw-version-ext-license',
894 if ( isset( $extension[
'descriptionmsg'] ) ) {
896 $descriptionMsg = $extension[
'descriptionmsg'];
898 if ( is_array( $descriptionMsg ) ) {
899 $descriptionMsgKey = array_shift( $descriptionMsg );
900 $descriptionMsg = array_map(
'htmlspecialchars', $descriptionMsg );
901 $description = $this->msg( $descriptionMsgKey, ...$descriptionMsg )->text();
903 $description = $this->msg( $descriptionMsg )->text();
905 } elseif ( isset( $extension[
'description'] ) ) {
907 $description = $extension[
'description'];
911 $description = $out->parseInlineAsInterface( $description );
914 $authors = $extension[
'author'] ?? [];
915 $authors = $this->listAuthors( $authors, $extension[
'name'], $extensionPath );
918 $html = Html::openElement(
'tr', [
919 'class' =>
'mw-version-ext',
920 'id' => Sanitizer::escapeIdForAttribute(
'mw-version-ext-' .
$type .
'-' . $extension[
'name'] )
924 $html .= Html::rawElement(
'td', [], $extensionNameLink );
925 $html .= Html::rawElement(
'td', [], $versionString );
926 $html .= Html::rawElement(
'td', [], $licenseLink );
927 $html .= Html::rawElement(
'td', [
'class' =>
'mw-version-ext-description' ], $description );
928 $html .= Html::rawElement(
'td', [
'class' =>
'mw-version-ext-authors' ], $authors );
930 $html .= Html::closeElement(
'tr' );
948 $ret[] =
'== {{int:version-hooks}} ==';
949 $ret[] = Html::openElement(
'table', [
'class' =>
'wikitable',
'id' =>
'sv-hooks' ] );
950 $ret[] = Html::openElement(
'tr' );
951 $ret[] = Html::element(
'th', [], $this->msg(
'version-hook-name' )->text() );
952 $ret[] = Html::element(
'th', [], $this->msg(
'version-hook-subscribedby' )->text() );
953 $ret[] = Html::closeElement(
'tr' );
955 foreach ( $myWgHooks as $hook => $hooks ) {
956 $ret[] = Html::openElement(
'tr' );
957 $ret[] = Html::element(
'td', [], $hook );
959 $ret[] = Html::element(
'td', [], $this->listToText( $hooks ) );
960 $ret[] = Html::closeElement(
'tr' );
963 $ret[] = Html::closeElement(
'table' );
965 return implode(
"\n", $ret );
974 $opt = [
'colspan' => 5 ];
975 if ( $this->firstExtOpened ) {
977 $out .= Html::rawElement(
'tr', [
'class' =>
'sv-space' ],
978 Html::element(
'td', $opt )
981 $this->firstExtOpened =
true;
984 $opt[
'id'] =
"sv-$name";
987 if ( $text !==
null ) {
988 $out .= Html::rawElement(
'tr', [],
989 Html::element(
'th', $opt, $text )
993 $firstHeadingMsg = ( $name ===
'credits-skin' )
994 ?
'version-skin-colheader-name'
995 :
'version-ext-colheader-name';
996 $out .= Html::openElement(
'tr' );
997 $out .= Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
998 $this->msg( $firstHeadingMsg )->text() );
999 $out .= Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1000 $this->msg(
'version-ext-colheader-version' )->text() );
1001 $out .= Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1002 $this->msg(
'version-ext-colheader-license' )->text() );
1003 $out .= Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1004 $this->msg(
'version-ext-colheader-description' )->text() );
1005 $out .= Html::element(
'th', [
'class' =>
'mw-version-ext-col-label' ],
1006 $this->msg(
'version-ext-colheader-credits' )->text() );
1007 $out .= Html::closeElement(
'tr' );
1018 $ip = str_replace(
'--',
' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
1020 return "<!-- visited from $ip -->\n<span style='display:none'>visited from $ip</span>";
1046 $linkRenderer = $this->getLinkRenderer();
1049 $authors = (array)$authors;
1054 if ( count( $authors ) === 1 && $authors[0] ===
'...' ) {
1057 if ( $extName && ExtensionInfo::getAuthorsFileName( $extDir ) ) {
1058 return $linkRenderer->makeLink(
1059 $this->getPageTitle(
"Credits/$extName" ),
1060 $this->msg(
'version-poweredby-various' )->text()
1063 return $this->msg(
'version-poweredby-various' )->escaped();
1069 foreach ( $authors as $item ) {
1070 if ( $item ==
'...' ) {
1073 if ( $extName && ExtensionInfo::getAuthorsFileName( $extDir ) ) {
1074 $text = $linkRenderer->makeLink(
1075 $this->getPageTitle(
"Credits/$extName" ),
1076 $this->msg(
'version-poweredby-others' )->text()
1079 $text = $this->msg(
'version-poweredby-others' )->escaped();
1082 } elseif ( substr( $item, -5 ) ==
' ...]' ) {
1084 $list[] = $this->getOutput()->parseInlineAsInterface(
1085 substr( $item, 0, -4 ) . $this->msg(
'version-poweredby-others' )->text() .
"]"
1088 $list[] = $this->getOutput()->parseInlineAsInterface( $item );
1092 if ( $extName && !$hasOthers && ExtensionInfo::getAuthorsFileName( $extDir ) ) {
1093 $list[] = $linkRenderer->makeLink(
1094 $this->getPageTitle(
"Credits/$extName" ),
1095 $this->msg(
'version-poweredby-others' )->text()
1099 return $this->listToText( $list,
false );
1116 return ExtensionInfo::getAuthorsFileName( $extDir );
1133 $licenses = ExtensionInfo::getLicenseFileNames( $extDir );
1134 if ( count( $licenses ) === 0 ) {
1137 return $licenses[0];
1149 if ( !count( $list ) ) {
1156 return $this->getLanguage()
1157 ->listToText( array_map( [ __CLASS__,
'arrayToString' ], $list ) );
1169 if ( is_array( $list ) && count( $list ) == 1 ) {
1172 if ( $list instanceof Closure ) {
1175 } elseif ( is_object( $list ) ) {
1176 $class =
wfMessage(
'parentheses' )->params( get_class( $list ) )->escaped();
1179 } elseif ( !is_array( $list ) ) {
1182 if ( is_object( $list[0] ) ) {
1183 $class = get_class( $list[0] );
1188 return wfMessage(
'parentheses' )->params(
"$class, {$list[1]}" )->escaped();
1199 return $repo->getHeadSHA1();
1208 return $repo->getCurrentBranch();
1216 $config = $this->getConfig();
1217 $scriptPath = $config->get(
'ScriptPath' ) ?:
'/';
1220 'version-entrypoints-articlepath' => $config->get(
'ArticlePath' ),
1221 'version-entrypoints-scriptpath' => $scriptPath,
1222 'version-entrypoints-index-php' =>
wfScript(
'index' ),
1223 'version-entrypoints-api-php' =>
wfScript(
'api' ),
1224 'version-entrypoints-rest-php' =>
wfScript(
'rest' ),
1227 $language = $this->getLanguage();
1229 'dir' => $language->getDir(),
1230 'lang' => $language->getHtmlCode()
1232 $out = Html::element(
1234 [
'id' =>
'mw-version-entrypoints' ],
1235 $this->msg(
'version-entrypoints' )->text()
1237 Html::openElement(
'table',
1239 'class' =>
'wikitable plainlinks',
1240 'id' =>
'mw-version-entrypoints-table',
1245 Html::openElement(
'tr' ) .
1249 $this->msg(
'version-entrypoints-header-entrypoint' )->text()
1254 $this->msg(
'version-entrypoints-header-url' )->text()
1256 Html::closeElement(
'tr' );
1258 foreach ( $entryPoints as $message => $value ) {
1260 $out .= Html::openElement(
'tr' ) .
1263 Html::rawElement(
'td', [], $this->msg( $message )->plain() ) .
1264 Html::rawElement(
'td', [], Html::rawElement(
'code', [],
"[$url $value]" ) ) .
1265 Html::closeElement(
'tr' );
1268 $out .= Html::closeElement(
'table' );
$wgHooks
Global list of hooks.
$wgSpecialVersionShowHooks
Show the contents of $wgHooks in Special:Version.
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.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
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.
Marks HTML that shouldn't be escaped.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
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.
IPInfo()
Get information about client's IP address.
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.
getWgHooks()
Generate wikitext showing hooks in $wgHooks.
static getCredits(ExtensionRegistry $reg, Config $conf)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getExtensionCategory( $type, $message, array $creditsGroup)
Creates and returns the HTML for a single extension category.
getExtensionCredits(array $credits)
Generate wikitext showing the name, URL, author and description of each extension.
listAuthors( $authors, $extName, $extDir)
Return a formatted unsorted list of authors.
static getSoftwareInformation()
Helper for self::softwareInformation().
string $coreId
The current rev id/SHA hash of MediaWiki core.
static softwareInformation()
Returns HTML showing the third party software versions (apache, php, mysql).
static getVersionLinkedGit()
static getExtensionTypes()
Returns an array with the base extension types.
openExtType( $text=null, $name=null)
getCreditsForExtension( $type, array $extension)
Creates and formats a version line for a single extension.
static getExtLicenseFileName( $extDir)
Obtains the full path of an extensions COPYING or LICENSE file if one exists.
static getMediaWikiCredits()
Returns wiki text showing the license information.
getParserTags()
Obtains a list of installed parser tags and the associated H2 header.
static getExtAuthorsFileName( $extDir)
Obtains the full path of an extensions AUTHORS or CREDITS file if one exists.
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 getMWVersionLinked()
static arrayToString( $list)
Convert an array or object to a string for display.
getSkinCredits(array $credits)
Generate wikitext showing the name, URL, author and description of each skin.
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