Index: http/classes/class_mb_exception.php =================================================================== --- http/classes/class_mb_exception.php (revision 1827) +++ http/classes/class_mb_exception.php (working copy) @@ -29,6 +29,8 @@ var $mb_log_level = LOG_LEVEL; var $dir = "../../log/"; var $filename_prefix = "mb_error_"; + var $result = false; + var $message = ""; function indexOf($level, $levelArray) { $index = false; @@ -57,11 +59,31 @@ if($h = fopen($logfile,"a")){ $content = date("Y.m.d, H:i:s") . "," . $n .chr(13).chr(10); if(!fwrite($h,$content)){ - #exit; + $this->result = false; + $this->message = "Unable to write " . $logfile; + return false; } fclose($h); + $this->result = true; + $this->message = "Successful."; + return true; + } + else { + $this->result = false; + $this->message = "Unable to open or generate " . $logfile; + return false; } } + else { + $this->result = false; + $this->message = "Directory " . $this->dir . " is not valid."; + return false; + } + } + else { + $this->result = false; + $this->message = "Log level '" . $level . "' is not valid or logging is disabled in mapbender.conf."; + return false; } } } @@ -70,7 +92,7 @@ var $level = "notice"; function mb_notice($message) { - $this->mb_log($message, $this->level); + return $this->mb_log("Notice: " . $message, $this->level); } } @@ -78,7 +100,7 @@ var $level = "warning"; function mb_warning($message) { - $this->mb_log($message, $this->level); + return $this->mb_log("Warning: " . $message, $this->level); } } @@ -86,7 +108,7 @@ var $level = "error"; function mb_exception($message) { - $this->mb_log($message, $this->level); + return $this->mb_log("ERROR: " . $message, $this->level); } } ?> \ No newline at end of file Index: http/tools/mapbender_setup.php =================================================================== --- http/tools/mapbender_setup.php (revision 1752) +++ http/tools/mapbender_setup.php (working copy) @@ -21,7 +21,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - include_once(dirname(__FILE__)."/../../conf/mapbender.conf"); +include_once(dirname(__FILE__)."/../../conf/mapbender.conf"); +include_once(dirname(__FILE__)."/../classes/class_mb_exception.php"); ?> - Mapbender Setupchecker + Mapbender Setup-Checker - +
"; - if (phpversion()>'4.3.0'){ - if (phpversion()<'5.1.0') $check .=""; + if (phpversion()>='5.1.0'){ + if (phpversion()<'5.2.0') $check .=""; else $check .=""; } - else $check .=""; + else $check .=""; #php-schnittstelle if(php_sapi_name() == 'cgi') $check.=""; else $check.=""; @@ -74,9 +75,14 @@ if (get_cfg_var('memory_limit')) $check .=""; else $check .=""; # error_reporting +#Error Reporting: 6135 =>error_reporting = E_ALL & ~E_NOTICE (6135-8(E_NOTICE)) +#Error Reporting: 1 => error_reporting = E_ERROR +#Error Reporting: 6143 => error_reporting = E_ALL $check .=""; - if (get_cfg_var('error_reporting')!=2039) $check .=""; - else $check .=""; + if (get_cfg_var('error_reporting')==6143||get_cfg_var('error_reporting')==8) $check .=""; + elseif (get_cfg_var('error_reporting')==6135)$check .=""; + elseif (get_cfg_var('error_reporting')==1)$check .=""; + else $check .=""; # session.save_handler if (!get_cfg_var('session.save_handler')||get_cfg_var('session.save_handler')!='files') $check .=""; else $check .=""; @@ -88,6 +94,10 @@ $check .=""; if (get_cfg_var('allow_url_fopen')=='1') $check .= ""; else $check .= ""; +# short_open_tag + $check .=""; + if (get_cfg_var('short_open_tag')!='1') $check .= ""; + else $check .= ""; echo $check; ################################################# #PHP Extensioncheck @@ -92,13 +102,10 @@ ################################################# #PHP Extensioncheck ################################################# -#MYSQL ?> -

 Mapbender @@ -53,11 +54,11 @@ ########################################### #phpversion $check ="

php VersionVersion: " . phpversion() . "! you should think about upgrade to >=php5.1!
Version: " . phpversion() . "! You should think about upgrade to the current php version (get it here)
XVersion: " . phpversion() . "
Version: " . phpversion() . "! your PHP is very old, think about upgrade to >=php5.1!
Version: " . phpversion() . "! Your PHP Version is very old, please upgrade to version >=5.1.0 to use full mapbender functionality and reduce problems!
interfaceXCGI-PHP
interfaceXModul-PHP
memory LimitX" . get_cfg_var('memory_limit') . " (running in memory-trouble with printing? Perhaps raise your memory limit)
memory Limitmemory_limit must be set (30M will be enough for the moment)
error-reportingplease set error_reporting to 'E_ALL & ~E_NOTICE' except for testing
Xok, error_reporting = E_ALL & ~E_NOTICE
please set error_reporting to 'E_ALL & ~E_NOTICE' or 'E_ERROR' except for debugging
Xok, error_reporting = E_ALL & ~E_NOTICE
Xok, error_reporting = E_ERROR
(Your error_reporting configuration is not implementet into this test yet. You shoul know what you are doing or set it to E_ALL & ~E_NOTICE)
session.save_handlersession.save_handler must be set to 'session.save_handler = files'!
session.save_handlerXsession.save_handler = " . get_cfg_var('session.save_handler') . "
allow_url_fopenXOn
Off =>allow_url_fopen must be on read this
short_open_tagXOff
On => Displaying XML files will not work properly
-

- "; else $check=""; #PGSQL @@ -107,7 +114,16 @@ #GD if(extension_loaded('gd')) $check.=""; else $check.=""; - echo $check; + +#mbstring + if(extension_loaded('mbstring')) $check.=""; + else $check.=""; + +#gettext + if(extension_loaded('gettext')) $check.=""; + else $check.=""; + +echo $check; #################################### # Database check #################################### @@ -130,22 +146,22 @@ $con_postgis = pg_connect($con_string); $sql = "Select postgis_full_version();"; $res = pg_query($con_postgis,$sql); - if(!$res) $check .=""; + if(!$res) $check .=""; else{ $cnt=0; while(pg_fetch_row($res)){ - $check .=""; + $check .=""; $check .=""; $cnt++; } - if ($cnt==0) $check .=""; + if ($cnt==0) $check .=""; } } - else $check .=""; + else $check .=""; echo $check; } else{ - $check = ""; + $check = ""; $check .= ""; if($con) $check .=""; else $check .=""; @@ -163,9 +179,6 @@ # PostGIS check ###################################### ?> -
PHP Extensioncheck MySQL checkMySQL not installed! (You have to include mysql-extension if you want to use MySQL as MB-Database!)
MySQL checkXMySQL installed
GD2 checkXGD installed
GD2 checkGD not installed (no printing possible)
mbstring checkXmbstring installed
mbstring checkPHP extension mbstring is not installed
gettext checkXgettext installed
gettext checkPHP extension gettext is not installed
PostGIS supportno PostGIS function available
PostGIS supportno PostGIS function available
PostGIS supportXPostGIS function available
PostGIS supportXPostGIS function available
VersionX" . pg_fetch_result($res,$cnt,0). "
PostGIS supportno PostGIS function available
PostGIS supportno PostGIS function available
Postgis supportno PostGIS function available
Postgis supportno PostGIS function available
Administration DatabaseXPostgreSQL
Administration DatabaseXPostgreSQL
Connect to DatabaseXconnected
not connected
-

- "; + if(!$res) $check .=""; else{ $cnt=0; while(pg_fetch_row($res)){ - $check .=""; + $check .=""; $check .=""; $cnt++; } - if ($cnt==0) $check .=""; + if ($cnt==0) $check .=""; } } - else $check .=""; + else $check .=""; echo $check; } ################################# @@ -194,7 +207,7 @@
PostGIS check pg_query($con,$sql)"; - if(!$res) $check .="
PostGIS supportno PostGIS function available
PostGIS supportno PostGIS function available
PostGIS supportXPostGIS function available
PostGIS supportXPostGIS function available
VersionX" . pg_fetch_result($res,$cnt,0). "
PostGIS supportno PostGIS function available
PostGIS supportno PostGIS function available
Postgis supportno PostGIS function available
Postgis supportno PostGIS function available


- + "; @@ -211,15 +224,15 @@ # PREPAREDSTATEMENTS if (defined('PREPAREDSTATEMENTS')){ if (PREPAREDSTATEMENTS == true){ - if (phpversion()<'5.1.0') $check.=""; - else $check .=""; + if (phpversion()<'5.1.0') $check.=""; + else $check .=""; } else{ - if (phpversion()<'5.1.0') $check .=""; - else $check .=""; + if (phpversion()<'5.1.0') $check .=""; + else $check .=""; } } - else $check .=""; + else $check .=""; # CHARSET if (CHARSET != "" && defined('CHARSET')) $check .=""; else $check .=""; @@ -226,14 +239,49 @@ # TMPDIR if (TMPDIR != "" && defined('TMPDIR')) $check .=""; else $check .=""; +# OWSPROXY + if (OWSPROXY != "" && defined('OWSPROXY')) $check .=""; + else $check .=""; +#AUTO_UPDATE + if (AUTO_UPDATE != "" && defined('AUTO_UPDATE')){ + if (AUTO_UPDATE == '1'){ + $check .=""; + if (!TIME_LIMIT || TIME_LIMIT == "")$check .=""; + } + elseif (AUTO_UPDATE == '0') $check .=""; + else $check .=""; + } + else $check .=""; +# ERROR LOGGING + $testLog = new mb_notice("This is a test run by the Mapbender setup script."); + if ($testLog->result) { + $check .=""; + } + else { + $check .=""; + } +#LOG_LEVEL (off,error,warning,all) + if (LOG_LEVEL !="" && defined('LOG_LEVEL')){ + if (LOG_LEVEL =='off') $check .=""; + elseif (LOG_LEVEL =='error') $check .=""; + elseif (LOG_LEVEL =='warning') $check .=""; + elseif (LOG_LEVEL =='all') $check .=""; + else $check .=""; + } +# PORTAL + if (defined('PORTAL')){ + if (PORTAL == true) $check .=""; + else $check .=""; + } + else $check .=""; # MAXLOGIN if (MAXLOGIN != "" && defined('MAXLOGIN')) $check .=""; - else $check .=""; + else $check .=""; # LOGIN - if (defined('LOGIN')) $check .= ""; + if (defined('LOGIN')) $check .= ""; else $check .= ""; echo $check; - echo ""; + echo ""; echo "
mapbender.conf checkMapbender Configuration Check Administration DatabaseX" . SYS_DBTYPE . "
PREPAREDSTATEMENTS-
compatibility
PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible
set PREPAREDSTATEMENTS to false or update php to >=5.1
PREPAREDSTATEMENTS-
compatibility
Xset to 'true' and php " . phpversion() . " should work
PREPAREDSTATEMENTSPREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible
set PREPAREDSTATEMENTS to false or update php to >=5.1
PREPAREDSTATEMENTSXset to 'true' and php " . phpversion() . " should work
PREPAREDSTATEMENTS-
compatibility
Xset to 'false' and php " . phpversion() . " should work (but think about upgrading to php 5.1)
PREPAREDSTATEMENTS-
compatibility
Xset to 'false' and php " . phpversion() . " should work (but you can set PREPAREDSTATEMENTS to 'true')
PREPAREDSTATEMENTS-
compatibility
Xset to 'false' and php " . phpversion() . " should work (but think about upgrading to php 5.1)
PREPAREDSTATEMENTS-
compatibility
Xset to 'false' and php " . phpversion() . " should work (but you can set PREPAREDSTATEMENTS to 'true')
PREPAREDSTATEMENTS-
compatibility
PREPAREDSTATEMENTS is not defined
PREPAREDSTATEMENTS-
compatibility
PREPAREDSTATEMENTS is not defined
CHARSETX" . CHARSET . "
CHARSETCHARSET is not defined
TMPDIRX" . TMPDIR . "
TMPDIRTMPDIR is not defined
OWSPROXYX" . OWSPROXY . " (Is this the right URL to your OWSPROXY?)
OWSPROXYOWSPROXY not defined(if you want to camouflage your WMS, you should think about OWSPROXY!)
AUTO_UPDATEXset to 1: will update all out-of-date WMS automatically
TIME_LIMITyou should define a TIME_LIMIT for the AUTO_UPDATE funtionallity
AUTO_UPDATEXset to 0: (see the result of the test and update WMS manually)
AUTO_UPDATEset to " . AUTO_UPDATE . ": this configuration value is not supported(as yet!)
AUTO_UPDATEAUTO_UPDATE not defined (for the wms monitoring functionality you have to define this constant)
ERROR LOGGINGX" . $testLog->message . "
ERROR LOGGING" . $testLog->message . "
LOG_LEVELXswitched off: -no Mapbender-errors logging
LOG_LEVELXset to 'error': -Mapbender-errors will be logged
LOG_LEVELXset to 'warning: - Mapbender-errors and -warnings will be logged
LOG_LEVELXset to 'all': -really every little notice will be logged!!
LOG_LEVELset to " . LOG_LEVEL . ": this configuration value is not supported (as yet!)
PORTALXtrue (Users can create theirs own accounts)
PORTALXfalse (Users can't create their own accounts at the moment)
PORTALPORTAL is not defined(Maybe an old configuration file?)
MAXLOGINX" . MAXLOGIN . "
MAXLOGINMAXLOGIN is not defined
MAXLOGINMAXLOGIN is not defined
Login-Path" . LOGIN . "
(if this link doesn't work, check out your 'URL to Login' in your mapbender.conf
Perhaps an alias in your httpd.conf will solve the prob')
Login-Path" . LOGIN . "
(If this link doesn't work, check your url to 'Login' in your mapbender.conf
Perhaps an alias in your httpd.conf will solve the problem, too)
Login-PathLOGIN is not defined
Legend:
red = maybe your Mapbender will run into trouble
blue = just a tip
green = seems to be alright
Legend:
red = maybe your Mapbender will run into trouble
blue = just a tip
green = seems to be alright
"; echo "for further informations visit  Mapbender installation instructions"; ?>