From 78e381ac7dcf305bf235c52009be6e7d2a1a56f3 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 2 Oct 2019 14:32:01 -0700 Subject: [PATCH] Drop HHVM support from MediaWiki This is just a first, top-level patch for documentation and the PHPVersionCheck class itself. Much more clean-up to follow. Bug: T192166 Change-Id: I50f5adc8d5fff604a14c8a889a31d3b92cc568c5 (cherry picked from commit ed8e9397adf9477c381f3880276a2e0917087a7b) --- RELEASE-NOTES-1.34 | 4 +--- composer.json | 2 +- includes/PHPVersionCheck.php | 27 +++++---------------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index 48fcbafb97..fcaed27bc3 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -607,9 +607,7 @@ because of Phabricator reports. * … == Compatibility == -MediaWiki 1.34 requires PHP 7.2.0 or later. Although HHVM 3.18.5 or later is -supported, it is generally advised to use PHP 7.2.0 or later for long term -support. It also requires the following PHP extensions: +MediaWiki 1.34 requires PHP 7.2.0 or later, and the following PHP extensions: * ctype * dom diff --git a/composer.json b/composer.json index bd34b922df..c92898bcfb 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "pear/mail": "1.4.1", "pear/mail_mime": "1.10.2", "pear/net_smtp": "1.8.1", - "php": ">=5.6.99", + "php": ">=7.0.0", "psr/container": "1.0.0", "psr/log": "1.0.2", "wikimedia/assert": "0.2.2", diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php index 8d642e1785..fe9a69c5d8 100644 --- a/includes/PHPVersionCheck.php +++ b/includes/PHPVersionCheck.php @@ -77,9 +77,8 @@ class PHPVersionCheck { /** * Return the version of the installed PHP implementation. * - * @param string|false $impl By default, the function returns the info of the currently installed - * PHP implementation. Using this parameter the caller can decide, what version info will be - * returned. Valid values: HHVM, PHP + * TODO: Deprecate/remove this workaround now that HHVM isn't supported. + * * @return array An array of information about the PHP implementation, containing: * - 'version': The version of the PHP implementation (specific to the implementation, not * the version of the implemented PHP version) @@ -90,20 +89,7 @@ class PHPVersionCheck { * - 'upgradeURL': The URL to the website of the implementation that contains * upgrade/installation instructions. */ - function getPHPInfo( $impl = false ) { - if ( - ( defined( 'HHVM_VERSION' ) && $impl !== 'PHP' ) || - $impl === 'HHVM' - ) { - return array( - 'implementation' => 'HHVM', - 'version' => defined( 'HHVM_VERSION' ) ? HHVM_VERSION : 'undefined', - 'vendor' => 'Facebook', - 'upstreamSupported' => '3.18.5', - 'minSupported' => '3.18.5', - 'upgradeURL' => 'https://docs.hhvm.com/hhvm/installation/introduction', - ); - } + function getPHPInfo() { return array( 'implementation' => 'PHP', 'version' => PHP_VERSION, @@ -120,18 +106,15 @@ class PHPVersionCheck { function checkRequiredPHPVersion() { $phpInfo = $this->getPHPInfo(); $minimumVersion = $phpInfo['minSupported']; - $otherInfo = $this->getPHPInfo( $phpInfo['implementation'] === 'HHVM' ? 'PHP' : 'HHVM' ); if ( version_compare( $phpInfo['version'], $minimumVersion ) < 0 ) { $shortText = "MediaWiki $this->mwVersion requires at least {$phpInfo['implementation']}" - . " version $minimumVersion or {$otherInfo['implementation']} version " - . "{$otherInfo['minSupported']}, you are using {$phpInfo['implementation']} " + . " version $minimumVersion, you are using {$phpInfo['implementation']} " . "{$phpInfo['version']}."; $longText = "Error: You might be using an older {$phpInfo['implementation']} version " . "({$phpInfo['implementation']} {$phpInfo['version']}). \n" . "MediaWiki $this->mwVersion needs {$phpInfo['implementation']}" - . " $minimumVersion or higher or {$otherInfo['implementation']} version " - . "{$otherInfo['minSupported']}.\n\nCheck if you have a" + . " $minimumVersion or higher.\n\nCheck if you have a" . " newer PHP executable with a different name.\n\n"; // phpcs:disable Generic.Files.LineLength -- 2.20.1