Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(install): check that PHP is greater or equal than 7.2 in installers
Browse files Browse the repository at this point in the history
* fix install php 7.2

* good name

* fix version_compare
  • Loading branch information
loiclau authored and Matthieu Kermagoret committed Oct 16, 2019
1 parent c10a409 commit 602de34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/CentreonLegacy/Core/Install/Step/Step1.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public function getContent()

public function setConfiguration()
{
if (version_compare(phpversion(), '7.2', '<')) {
throw new \Exception('Please update your PHP to 7.2 or upper.');
}

$configurationFile = __DIR__ . "/../../../../../www/install/install.conf.php";

if (!$this->dependencyInjector['filesystem']->exists($configurationFile)) {
Expand Down
5 changes: 4 additions & 1 deletion www/install/step_upgrade/step1.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@

$title = _('Centreon Upgrade');

if (is_file('../install.conf.php')) {
if (version_compare(phpversion(), '7.2', '<')) {
$status = 1;
$content = sprintf("<p class='required'>%s</p>", _('Please update your PHP to 7.2 or upper.'));
} elseif (is_file('../install.conf.php')) {
$status = 0;
$content = sprintf(
"<p>%s%s</p>",
Expand Down

0 comments on commit 602de34

Please sign in to comment.