Added check for PHP version

Page stops loading and alert is shown if version less than  7.4
This commit is contained in:
cp6 2021-02-03 00:29:26 +11:00
parent 389a082fbc
commit 0d9416f481

View File

@ -2100,6 +2100,7 @@ class idlers extends helperFunctions
public function mainPage()
{
$this->checkPHPversion();//Check PHP version. Wont load if not PHP 7.4 or above
$this->pageHead();
$this->pageContents();
$this->pageFooter();
@ -3154,6 +3155,14 @@ class idlers extends helperFunctions
return $id;
}
protected function checkPHPversion()
{
if (version_compare(PHP_VERSION, '7.4') === -1) {
echo "<script type='text/javascript'>alert('My idlers requires PHP 7.4 as a minimum version. You have " . PHP_VERSION . " installed');</script>";
exit;
}
}
//Compare functions
protected function compatibleComparesSelect()
{