From edc5a90da13c5d3ec23082425f48cdf987faf720 Mon Sep 17 00:00:00 2001 From: Alangi Derick Date: Thu, 18 Oct 2018 18:50:48 +0100 Subject: [PATCH] Add docs and minor cleanup in PHPVersionCheck.php - Consistency of the acronym PHP instead of "php". - Add documentation to $functionsExtensionsMapping. Change-Id: I06b507128bc3b95605a764cd63f621dbae3b2dc3 --- includes/PHPVersionCheck.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php index 66fa9bd349..aee2a0cb92 100644 --- a/includes/PHPVersionCheck.php +++ b/includes/PHPVersionCheck.php @@ -27,8 +27,10 @@ * @class */ class PHPVersionCheck { - /* @var string The number of the MediaWiki version used */ + /* @var string The number of the MediaWiki version used. */ var $mwVersion = '1.33'; + + /* @var array A mapping of PHP functions to PHP extensions. */ var $functionsExtensionsMapping = array( 'mb_substr' => 'mbstring', 'xml_parser_create' => 'xml', @@ -61,14 +63,14 @@ class PHPVersionCheck { } /** - * Returns the version of the installed php implementation. + * Returns the version of the installed PHP implementation. * * @param string $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 - * @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) + * @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) * - 'implementation': The name of the implementation used * - 'vendor': The development group, vendor or developer of the implementation. * - 'upstreamSupported': The minimum version of the implementation supported by the named vendor. @@ -101,7 +103,7 @@ class PHPVersionCheck { } /** - * Displays an error, if the installed php version does not meet the minimum requirement. + * Displays an error, if the installed PHP version does not meet the minimum requirement. */ function checkRequiredPHPVersion() { $phpInfo = $this->getPHPInfo(); @@ -121,7 +123,7 @@ class PHPVersionCheck { . "MediaWiki $this->mwVersion needs {$phpInfo['implementation']}" . " $minimumVersion or higher or {$otherInfo['implementation']} version " . "{$otherInfo['minSupported']}.\n\nCheck if you have a" - . " newer php executable with a different name.\n\n"; + . " newer PHP executable with a different name.\n\n"; // phpcs:disable Generic.Files.LineLength $longHtml = <<