summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f9cffb)
raw | patch | inline | side by side (parent: 4f9cffb)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 21 May 2005 09:59:29 +0000 (09:59 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 21 May 2005 09:59:29 +0000 (09:59 +0000) |
include/setup_checks.inc | patch | blob | history |
index 09242c6fedf5920692b83c45ae016a37f3aabc1c..2195c9b0ec8033ff4701bcd66e2e1714c2296ffc 100644 (file)
--- a/include/setup_checks.inc
+++ b/include/setup_checks.inc
<?php
-
-
-
-function minimum_version($vercheck)
-{
- $needver = split("\.",$vercheck);
- $curver = split("\.",phpversion());
-
- $c1 = count($needver);
- $c2 = count($curver);
-
- if($c2 >= $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);
$msg.= "<h1>"._("PHP setup inspection")."</h1>";
$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."),