Skip to content

Commit

Permalink
installer verify php version fix magento#1066
Browse files Browse the repository at this point in the history
  • Loading branch information
horobeanu committed Mar 6, 2015
1 parent 6effa36 commit 9e27242
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
6 changes: 3 additions & 3 deletions setup/src/Magento/Setup/Controller/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ public function phpVersionAction()
{
try {
$requiredVersion = $this->phpInformation->getRequiredPhpVersion();
$multipleConstraints = $this->versionParser->parseConstraints($requiredVersion);
$currentPhpVersion = $this->versionParser->parseConstraints(strtok(PHP_VERSION,'-'));
} catch (\Exception $e) {
return new JsonModel(
[
'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR,
'data' => [
'error' => 'phpVersionError',
'exception' => 'phpVersionException',
'message' => 'Cannot determine required PHP version: ' . $e->getMessage()
],
]
);
}
$multipleConstraints = $this->versionParser->parseConstraints($requiredVersion);
$currentPhpVersion = $this->versionParser->parseConstraints(PHP_VERSION);
$responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS;
if (!$multipleConstraints->matches($currentPhpVersion)) {
$responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR;
Expand Down
53 changes: 36 additions & 17 deletions setup/view/magento/setup/readiness-check/progress.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,45 @@

<div class="readiness-check-item" ng-switch-default ng-init="updateOnError(version)">

<div class="rediness-check-side">
<p class="side-title">Need Help?</p>
<a href="http://www.php.net/docs.php" target="_blank">PHP Documentation</a>


<div ng-show="version.data.exception" ng-switch="version.data.exception">
<div ng-switch-when="phpVersionException" class="alert alert-warning">
<span class="alert-icon icon-failed-round"></span>
<p class="alert-text">
{{version.data.message}}
</p>
</div>

<span class="readiness-check-icon icon-failed-round"></span>

<div class="readiness-check-content">
<h3 class="readiness-check-title">PHP Version Check</h3>
</div>
</div>

<span class="readiness-check-icon icon-failed-round"></span>
<div ng-show="version.data.required">
<span class="readiness-check-icon icon-failed-round"></span>

<div class="readiness-check-content">
<h3 class="readiness-check-title">PHP Version Check</h3>
<p>
Your PHP version is {{version.data.current}}. The required PHP version is {{version.data.required}}.
<a href="#php-version" ng-click="updateOnExpand(version)">
<span ng-hide="version.expanded">Show detail</span>
<span ng-show="version.expanded">Hide detail</span>
</a>
</p>
<p ng-show="version.expanded">
Donwload and install PHP version {{version.data.required}} from <a href="http://www.php.net" target="_blank">www.php.net</a> using this <a href="http://www.php.net/docs.php" target="_blank">PHP Documentation</a>.
</p>
<p ng-show="version.expanded">If you need more help please call your hosting provider.</p>
<div class="readiness-check-content">
<h3 class="readiness-check-title">PHP Version Check</h3>
<p>
Your PHP version is {{version.data.current}}. The required PHP version is {{version.data.required}}.
<a href="#php-version" ng-click="updateOnExpand(version)">
<span ng-hide="version.expanded">Show detail</span>
<span ng-show="version.expanded">Hide detail</span>
</a>
</p>
<p ng-show="version.expanded">
Donwload and install PHP version {{version.data.required}} from <a href="http://www.php.net" target="_blank">www.php.net</a> using this <a href="http://www.php.net/docs.php" target="_blank">PHP Documentation</a>.
</p>
<p ng-show="version.expanded">If you need more help please call your hosting provider.</p>
</div>
</div>

<div class="rediness-check-side">
<p class="side-title">Need Help?</p>
<a href="http://www.php.net/docs.php" target="_blank">PHP Documentation</a>
</div>

</div>
Expand Down

0 comments on commit 9e27242

Please sign in to comment.