Skip to content

Commit d3e03ff

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

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 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->normalizePhpVersion(PHP_VERSION);
68+
$normalizedPhpVersion = $this->normalizeCurrentPhpVersion();
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->normalizePhpVersion(PHP_VERSION);
199+
$normalizedPhpVersion = $this->normalizeCurrentPhpVersion();
200200
$currentVersion = $this->versionParser->parseConstraints($normalizedPhpVersion);
201201
if ($checkVersionConstraint->matches($currentVersion) && $iniSetting !== -1) {
202202
$error = true;
@@ -221,19 +221,17 @@ private function checkPopulateRawPostSetting()
221221
return $data;
222222
}
223223

224-
225224
/**
226225
* Normalize PHP Version
227226
*
228-
* @param string $version
229227
* @return string
230228
*/
231-
private function normalizePhpVersion($version)
229+
private function normalizeCurrentPhpVersion()
232230
{
233231
try {
234-
$normalizedPhpVersion = $this->versionParser->normalize($version);
232+
$normalizedPhpVersion = $this->versionParser->normalize(PHP_VERSION);
235233
} catch (\UnexpectedValueException $e) {
236-
$prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', $version);
234+
$prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', PHP_VERSION);
237235
$normalizedPhpVersion = $this->versionParser->normalize($prettyVersion);
238236
}
239237
return $normalizedPhpVersion;

0 commit comments

Comments
 (0)