From 709c0cb3596589ff36ca6612e55ad20e97cd302b Mon Sep 17 00:00:00 2001 From: gregb_cc Date: Tue, 17 Dec 2002 03:02:53 +0000 Subject: [PATCH] added in a commented out reimplementation of check_php_version, that will most likely never be used. --- lib/moodlelib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 8409ba11120..93acf868803 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2134,7 +2134,14 @@ function check_php_version($version="4.1.0") { $minversion = intval(str_replace(".", "", $version)); $curversion = intval(str_replace(".", "", phpversion())); return ($curversion >= $minversion); -// return version_compare(phpversion(), $version, ">="); +# below is a slightly different implementation, that is faster, but cannot check +# versions isn't flexible in testing versions lower than 4.1.0 +// if (function_exists(version_compare)){ +// return version_compare(PHP_VERSION, $version, ">="); +// } else { +// # version_compare does not exist pre 4.1.0, so we know that the users version is too old. +// return false; +// } } function check_browser_version($brand="MSIE", $version=5.5) {