Merge "Indicate the actual version of HHVM in use"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 27 Aug 2014 22:42:12 +0000 (22:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 27 Aug 2014 22:42:12 +0000 (22:42 +0000)
includes/api/ApiQuerySiteinfo.php
includes/debug/MWDebug.php
includes/installer/Installer.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json
includes/specials/SpecialVersion.php
resources/src/mediawiki/mediawiki.debug.js
tests/phpunit/includes/debug/MWDebugTest.php

index f17ac29..04892a1 100644 (file)
@@ -138,6 +138,9 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
                $data['phpversion'] = PHP_VERSION;
                $data['phpsapi'] = PHP_SAPI;
+               if ( defined( 'HHVM_VERSION' ) ) {
+                       $data['hhvmversion'] = HHVM_VERSION;
+               }
                $data['dbtype'] = $config->get( 'DBtype' );
                $data['dbversion'] = $this->getDB()->getServerVersion();
 
index 01e0ba0..fb11f36 100644 (file)
@@ -538,7 +538,8 @@ class MWDebug {
 
                return array(
                        'mwVersion' => $wgVersion,
-                       'phpVersion' => PHP_VERSION,
+                       'phpEngine' => wfIsHHVM() ? 'HHVM' : 'PHP',
+                       'phpVersion' => wfIsHHVM() ? HHVM_VERSION : PHP_VERSION,
                        'gitRevision' => GitInfo::headSHA1(),
                        'gitBranch' => GitInfo::currentBranch(),
                        'gitViewUrl' => GitInfo::headViewUrl(),
index aca3119..987925c 100644 (file)
@@ -434,7 +434,11 @@ abstract class Installer {
        public function doEnvironmentChecks() {
                // Php version has already been checked by entry scripts
                // Show message here for information purposes
-               $this->showMessage( 'config-env-php', PHP_VERSION );
+               if ( wfIsHHVM() ) {
+                       $this->showMessage( 'config-env-hhvm', HHVM_VERSION );
+               } else {
+                       $this->showMessage( 'config-env-php', PHP_VERSION );
+               }
 
                $good = true;
                // Must go here because an old version of PCRE can prevent other checks from completing
index ca328cf..1e1c2da 100644 (file)
@@ -44,6 +44,7 @@
        "config-env-good": "The environment has been checked.\nYou can install MediaWiki.",
        "config-env-bad": "The environment has been checked.\nYou cannot install MediaWiki.",
        "config-env-php": "PHP $1 is installed.",
+       "config-env-hhvm": "HHVM $1 is installed.",
        "config-unicode-using-utf8": "Using Brion Vibber's utf8_normalize.so for Unicode normalization.",
        "config-unicode-using-intl": "Using the [http://pecl.php.net/intl intl PECL extension] for Unicode normalization.",
        "config-unicode-pure-php-warning": "<strong>Warning:</strong> The [http://pecl.php.net/intl intl PECL extension] is not available to handle Unicode normalization, falling back to slow pure-PHP implementation.\nIf you run a high-traffic site, you should read a little on [//www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations Unicode normalization].",
index 8126862..c879843 100644 (file)
@@ -62,6 +62,7 @@
        "config-env-good": "See also:\n* {{msg-mw|Config-env-bad}}",
        "config-env-bad": "See also:\n* {{msg-mw|Config-env-good}}",
        "config-env-php": "Parameters:\n* $1 - the version of PHP that has been installed\nSee also:\n* {{msg-mw|config-env-php-toolow}}",
+       "config-env-hhvm": "Parameters:\n* $1 - the version of HHVM that has been installed",
        "config-unicode-using-utf8": "Status message in the MediaWiki installer environment checks.",
        "config-unicode-using-intl": "Status message in the MediaWiki installer environment checks.",
        "config-unicode-pure-php-warning": "PECL is the name of a group producing standard pieces of software for PHP, and intl is the name of their library handling some aspects of internationalization.",
index 4b1abac..97c7704 100644 (file)
@@ -212,9 +212,11 @@ class SpecialVersion extends SpecialPage {
                // wikimarkup can be used.
                $software = array();
                $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
-               $phpKey = wfIsHHVM() ? '[http://hhvm.com/ HHVM]' :
-                       '[https://php.net/ PHP]';
-               $software[$phpKey] = PHP_VERSION . " (" . PHP_SAPI . ")";
+               if ( wfIsHHVM() ) {
+                       $software['[http://hhvm.com/ HHVM]'] = HHVM_VERSION . " (" . PHP_SAPI . ")";
+               } else {
+                       $software['[https://php.net/ PHP]'] = PHP_VERSION . " (" . PHP_SAPI . ")";
+               }
                $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
 
                // Allow a hook to add/remove items.
index f56f0d9..505a9be 100644 (file)
                        }
 
                        bitDiv( 'phpversion' )
-                               .append( $( '<a href="//www.php.net/"></a>' ).text( 'PHP' ) )
+                               .append( $( this.data.phpEngine === 'HHVM'
+                                       ? '<a href="http://hhvm.com/">HHVM</a>'
+                                       : '<a href="https://php.net/">PHP</a>'
+                               ) )
                                .append( ': ' + this.data.phpVersion );
 
                        bitDiv( 'time' )
index 17c6224..6e41de7 100644 (file)
@@ -103,7 +103,7 @@ class MWDebugTest extends MediaWikiTestCase {
                $this->assertInstanceOf( 'ApiResult', $result );
                $data = $result->getData();
 
-               $expectedKeys = array( 'mwVersion', 'phpVersion', 'gitRevision', 'gitBranch',
+               $expectedKeys = array( 'mwVersion', 'phpEngine', 'phpVersion', 'gitRevision', 'gitBranch',
                        'gitViewUrl', 'time', 'log', 'debugLog', 'queries', 'request', 'memory',
                        'memoryPeak', 'includes', 'profile', '_element' );