From 91d0d0d1a3b82c2eb60e7d378e10f7d33c4910a6 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 21 May 2005 09:59:29 +0000 Subject: [PATCH] Simplified PHP version detection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@316 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/setup_checks.inc | 50 +--------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/include/setup_checks.inc b/include/setup_checks.inc index 09242c6fe..2195c9b0e 100644 --- a/include/setup_checks.inc +++ b/include/setup_checks.inc @@ -1,48 +1,5 @@ = $c1) $c1 = $c2; - - for($i=0; $i < $c1 ; $i++) - { - // no success - if($needver[$i] > $curver[$i]) - { - return(false); - } - // current ist higher - if($needver[$i] < $curver[$i]) - { - return(true); - } - // Number is Equal - } - return (true); -} - -function minimum_versioni2($vercheck) -{ - $minver = (int)str_replace('.', '', $vercheck); - $curver = (int)str_replace('.', '', phpversion()); - - if($curver >= $minver){ - return (true); - } - - return (false); -} - - function check_schema_version($description, $version) { $desc= preg_replace("/^.* DESC\s+\(*\s*'([^']+)'\s*\)*.*$/", '\\1', $description); @@ -262,12 +219,7 @@ function perform_php_checks(&$faults) $msg.= "

"._("PHP setup inspection")."

"; $msg.= check ( $faults, _("Checking for PHP version (>=4.1.0)"), _("PHP must be of version 4.1.0 or above for some functions and known bugs in PHP language."), - minimum_version('4.1.0')); - - $msg.= check ( $faults, _("Checking for PHP version (<=5)"), - _("PHP must be below version 5."), - !minimum_version('5')); - + version_compare(phpversion(), "4.1.0")>=0); $msg.= check ( $faults, _("Checking if register_globals is set to 'off'"), _("register_globals is a PHP mechanism to register all global varibales to be accessible from scripts without changing the scope. This may be a security risk. GOsa will run in both modes."), -- 2.30.2