1
0
mirror of https://github.com/cp6/my-idlers.git synced 2024-11-16 23:42:32 +01:00

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() public function mainPage()
{ {
$this->checkPHPversion();//Check PHP version. Wont load if not PHP 7.4 or above
$this->pageHead(); $this->pageHead();
$this->pageContents(); $this->pageContents();
$this->pageFooter(); $this->pageFooter();
@ -3154,6 +3155,14 @@ class idlers extends helperFunctions
return $id; 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 //Compare functions
protected function compatibleComparesSelect() protected function compatibleComparesSelect()
{ {