From e8eea39b9d3317696731b66e75d8713058df6a7b Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 1 Jan 2019 20:38:51 +0000 Subject: [PATCH] reformat; try and persuade people to move off use of "mysql" (to mysqli); add php version warning --- public/setup.php | 126 ++++++++++++++++++----------------------------- 1 file changed, 49 insertions(+), 77 deletions(-) diff --git a/public/setup.php b/public/setup.php index c3cdd9bd..d6dee3f8 100644 --- a/public/setup.php +++ b/public/setup.php @@ -64,21 +64,18 @@ $errormsg = array(); $phpversion = 'unknown-version'; if ($f_phpversion == 1) { - if (phpversion() < 5) { + if (version_compare(phpversion(), '5', '<')) { print "
  • Error: Depends on: PHP v5+
  • \n"; $error += 1; - } elseif (version_compare(phpversion(), '5.2.3') < 0) { - # smarty uses htmlentities() with 4 parameters, the 4th parameter was introduced in PHP 5.2.3 - # older PHP versions will cause warnings + } elseif (version_compare(phpversion(), '7.0') < 0) { $phpversion = 5; - print "
  • Recommended PHP version: >= 5.2.3, you have " . phpversion() . "
  • \n"; + print "
  • Recommended PHP version: >= 7.0, you have " . phpversion() . "; you should upgrade.
  • \n"; } else { - $phpversion = 5; - print "
  • PHP version " . phpversion() . "
  • \n"; + print "
  • PHP version " . phpversion() . " - Good
  • \n"; } - # TODO: check for PHP >= 5.2.3 - smarty uses htmlentities with 4 parameters. The forth parameter was added in PHP 5.2.3, older versions will give a warning } else { - print "
  • Unable to check for PHP version. (missing function: phpversion())
  • \n"; + print "
  • DANGER Unable to check for PHP version. (missing function: phpversion())
  • \n"; + $error++; } // @@ -93,7 +90,7 @@ if ($f_apache_get_version == 1) { } print ""; -print "

    Checking for dependencies:\n"; +print "

    Checking environment:\n"; print "