From e73328601d51674e8fef89c3db12b30ceafd702f Mon Sep 17 00:00:00 2001 From: Reedy Date: Wed, 26 Jun 2019 14:18:21 +0000 Subject: [PATCH] Output more MW version info in update.php Bug: T226636 Change-Id: I0d5b7c3ff7d95fe759f16435da37092df14fd042 --- includes/specials/SpecialVersion.php | 34 +++++++++++++++++++--------- maintenance/update.php | 4 ++++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 5456ce7861..ec34db8611 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -219,23 +219,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 +248,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 . " diff --git a/maintenance/update.php b/maintenance/update.php index b6c7ae473b..fe405364c9 100755 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -123,6 +123,10 @@ class UpdateMediaWiki extends Maintenance { $this->output( "MediaWiki {$wgVersion} Updater\n\n" ); + foreach ( SpecialVersion::getSoftwareInformation() as $name => $version ) { + $this->output( "{$name}: {$version}\n" ); + } + wfWaitForSlaves(); if ( !$this->hasOption( 'skip-compat-checks' ) ) { -- 2.20.1