X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialVersion.php;h=fa78cbe7ba499b9a8a83a9af2502acb76fed87ae;hb=9d9b2e385414c4cde629e8745088dfa48a61f12f;hp=0c4959a48e948b370957606436289c3a19bfb030;hpb=8b5b49cb6d8c9df839b7d6bc70590b040cc4ebda;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 0c4959a48e..fa78cbe7ba 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -31,13 +31,20 @@ use MediaWiki\MediaWikiServices; * @ingroup SpecialPage */ class SpecialVersion extends SpecialPage { + + /** + * @var bool + */ protected $firstExtOpened = false; /** - * Stores the current rev id/SHA hash of MediaWiki core + * @var string The current rev id/SHA hash of MediaWiki core */ protected $coreId = ''; + /** + * @var string[]|false Lazy initialized key/value with message content + */ protected static $extensionTypes = false; public function __construct() { @@ -219,23 +226,26 @@ class SpecialVersion extends SpecialPage { } /** - * Returns wiki text showing the third party software versions (apache, php, mysql). + * @since 1.34 * - * @return string + * @return array */ - public static function softwareInformation() { + public static function getSoftwareInformation() { $dbr = wfGetDB( DB_REPLICA ); // Put the software in an array of form 'name' => 'version'. All messages should // be loaded here, so feel free to use wfMessage in the 'name'. Raw HTML or // wikimarkup can be used. - $software = []; - $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked(); + $software = [ + '[https://www.mediawiki.org/ MediaWiki]' => self::getVersionLinked() + ]; + if ( wfIsHHVM() ) { $software['[https://hhvm.com/ HHVM]'] = HHVM_VERSION . " (" . PHP_SAPI . ")"; } else { $software['[https://php.net/ PHP]'] = PHP_VERSION . " (" . PHP_SAPI . ")"; } + $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo(); if ( defined( 'INTL_ICU_VERSION' ) ) { @@ -245,18 +255,27 @@ class SpecialVersion extends SpecialPage { // Allow a hook to add/remove items. Hooks::run( 'SoftwareInfo', [ &$software ] ); + return $software; + } + + /** + * Returns HTML showing the third party software versions (apache, php, mysql). + * + * @return string HTML table + */ + public static function softwareInformation() { $out = Xml::element( 'h2', [ 'id' => 'mw-version-software' ], wfMessage( 'version-software' )->text() ) . - Xml::openElement( 'table', [ 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ] ) . - " - " . wfMessage( 'version-software-product' )->text() . " - " . wfMessage( 'version-software-version' )->text() . " - \n"; + Xml::openElement( 'table', [ 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ] ) . + " + " . wfMessage( 'version-software-product' )->text() . " + " . wfMessage( 'version-software-version' )->text() . " + \n"; - foreach ( $software as $name => $version ) { + foreach ( self::getSoftwareInformation() as $name => $version ) { $out .= " " . $name . " " . $version . " @@ -367,7 +386,7 @@ class SpecialVersion extends SpecialPage { * * @since 1.17 * - * @return array + * @return string[] */ public static function getExtensionTypes() { if ( self::$extensionTypes === false ) { @@ -812,7 +831,7 @@ class SpecialVersion extends SpecialPage { } // ... and generate the description; which can be a parameterized l10n message - // in the form array( , , ... ) or just a straight + // in the form [ , , ... ] or just a straight // up string if ( isset( $extension['descriptionmsg'] ) ) { // Localized description of extension