Skip to content

Commit 89ea86b

Browse files
committed
MAGETWO-44547: [php7] "PHP Settings Check" fail in Web Setup Wizard blocks installation via web
- addressed CR feedback
1 parent d3e03ff commit 89ea86b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

setup/src/Magento/Setup/Model/PhpReadinessCheck.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function checkPhpVersion()
6565
];
6666
}
6767
$multipleConstraints = $this->versionParser->parseConstraints($requiredVersion);
68-
$normalizedPhpVersion = $this->normalizeCurrentPhpVersion();
68+
$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION);
6969
$currentPhpVersion = $this->versionParser->parseConstraints($normalizedPhpVersion);
7070
$responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS;
7171
if (!$multipleConstraints->matches($currentPhpVersion)) {
@@ -196,7 +196,7 @@ private function checkPopulateRawPostSetting()
196196
$iniSetting = intVal(ini_get('always_populate_raw_post_data'));
197197

198198
$checkVersionConstraint = $this->versionParser->parseConstraints('~5.6.0');
199-
$normalizedPhpVersion = $this->normalizeCurrentPhpVersion();
199+
$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION);
200200
$currentVersion = $this->versionParser->parseConstraints($normalizedPhpVersion);
201201
if ($checkVersionConstraint->matches($currentVersion) && $iniSetting !== -1) {
202202
$error = true;
@@ -224,14 +224,15 @@ private function checkPopulateRawPostSetting()
224224
/**
225225
* Normalize PHP Version
226226
*
227+
* @param string $version
227228
* @return string
228229
*/
229-
private function normalizeCurrentPhpVersion()
230+
private function getNormalizedCurrentPhpVersion($version)
230231
{
231232
try {
232-
$normalizedPhpVersion = $this->versionParser->normalize(PHP_VERSION);
233+
$normalizedPhpVersion = $this->versionParser->normalize($version);
233234
} catch (\UnexpectedValueException $e) {
234-
$prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', PHP_VERSION);
235+
$prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', $version);
235236
$normalizedPhpVersion = $this->versionParser->normalize($prettyVersion);
236237
}
237238
return $normalizedPhpVersion;

0 commit comments

Comments
 (0)