PHP max version check added

This commit is contained in:
Manish Verma
2021-02-18 17:09:53 +05:30
parent 3c1336be3f
commit ca895a67a2
2 changed files with 5 additions and 5 deletions

View File

@@ -116,10 +116,10 @@ $bootstrapPermission = substr(sprintf('%o', fileperms($basePath.DIRECTORY_SEPARA
</tr>
<?php
echo '<tr>';
if (version_compare(phpversion(), '7.1.9', '>=') == 1) {
echo "<td>PHP Version</td> <td style='color:green'>".phpversion().'</td>';
if (version_compare(phpversion(), '7.1') == -1 || version_compare('7.1.50', phpversion()) == -1) {
echo "<td>PHP Version</td> <td style='color:red'>".phpversion().'<p>Recommended PHP version 7.1</p></td>';
} else {
echo "<td>PHP Version</td> <td style='color:red'>".phpversion().'<p>Please upgrade PHP Version to 7.1.3 or greater version </p></td>';
echo "<td>PHP Version</td> <td style='color:green'>".phpversion().'</td>';
}
echo '</tr>';
echo '<tr>';

View File

@@ -55,8 +55,8 @@ class TestResult {
<?php
function validate_php(&$results) {
if (version_compare(PHP_VERSION, '7.1.3') == -1) {
$results[] = new TestResult('PHP version required in order to run Faveo HELPDESK is PHP 7.1.3 or greater. Your PHP version: ' . PHP_VERSION, STATUS_ERROR);
if (version_compare(PHP_VERSION, '7.1') == -1 || version_compare('7.1.50', PHP_VERSION) == -1) {
$results[] = new TestResult('PHP version required in order to run Faveo HELPDESK is PHP 7.1.* PHP version greater or lesser than 7.1 are not supported yet. Your PHP version: ' . PHP_VERSION, STATUS_ERROR);
return false;
} else {
$results[] = new TestResult('Your PHP version is ' . PHP_VERSION, STATUS_OK);