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
@@ -53,11 +54,11 @@
###########################################
#phpversion
$check ="php Version | ";
- if (phpversion()>'4.3.0'){
- if (phpversion()<'5.1.0') $check .="Version: " . phpversion() . "! you should think about upgrade to >=php5.1! | | X | Version: " . phpversion() . " | "; } - else $check .="Version: " . phpversion() . "! your PHP is very old, think about upgrade to >=php5.1! | "; + else $check .="Version: " . phpversion() . "! Your PHP Version is very old, please upgrade to version >=5.1.0 to use full mapbender functionality and reduce problems! | "; #php-schnittstelle if(php_sapi_name() == 'cgi') $check.="
interface | X | CGI-PHP | |||
interface | X | Modul-PHP | |||
memory Limit | X | " . get_cfg_var('memory_limit') . " (running in memory-trouble with printing? Perhaps raise your memory limit) | |||
memory Limit | memory_limit must be set (30M will be enough for the moment) | ||||
error-reporting | "; - if (get_cfg_var('error_reporting')!=2039) $check .="please set error_reporting to 'E_ALL & ~E_NOTICE' except for testing | X | ok, error_reporting = E_ALL & ~E_NOTICE | "; + if (get_cfg_var('error_reporting')==6143||get_cfg_var('error_reporting')==8) $check .="please set error_reporting to 'E_ALL & ~E_NOTICE' or 'E_ERROR' except for debugging | "; + elseif (get_cfg_var('error_reporting')==6135)$check .="X | ok, error_reporting = E_ALL & ~E_NOTICE | "; + elseif (get_cfg_var('error_reporting')==1)$check .="X | ok, error_reporting = E_ERROR | "; + else $check .="(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_handler if (!get_cfg_var('session.save_handler')||get_cfg_var('session.save_handler')!='files') $check .="
session.save_handler | session.save_handler must be set to 'session.save_handler = files'! | ||||
session.save_handler | X | session.save_handler = " . get_cfg_var('session.save_handler') . " | |||
allow_url_fopen | "; if (get_cfg_var('allow_url_fopen')=='1') $check .= "X | On | Off =>allow_url_fopen must be on read this | "; +# short_open_tag + $check .="||
short_open_tag | "; + if (get_cfg_var('short_open_tag')!='1') $check .= "X | Off | On => Displaying XML files will not work properly | "; echo $check; ################################################# #PHP Extensioncheck @@ -92,13 +102,10 @@ ################################################# #PHP Extensioncheck ################################################# -#MYSQL ?> -
PHP Extensioncheck | MySQL check | MySQL not installed! (You have to include mysql-extension if you want to use MySQL as MB-Database!) | "; else $check="
---|---|---|
MySQL check | X | MySQL installed |
GD2 check | X | GD installed |
GD2 check | GD not installed (no printing possible) | |
mbstring check | X | mbstring installed |
mbstring check | PHP extension mbstring is not installed | |
gettext check | X | gettext installed |
gettext check | PHP extension gettext is not installed | |
PostGIS support | no PostGIS function available | |
PostGIS support | no PostGIS function available | |
PostGIS support | X | PostGIS function available |
PostGIS support | X | PostGIS function available |
Version | X | " . pg_fetch_result($res,$cnt,0). " |
PostGIS support | no PostGIS function available | |
PostGIS support | no PostGIS function available | |
Postgis support | no PostGIS function available | |
Postgis support | no PostGIS function available | |
Administration Database | X | PostgreSQL |
Administration Database | X | PostgreSQL |
Connect to Database | "; if($con) $check .="X | connected | not connected | "; @@ -163,9 +179,6 @@ # PostGIS check ###################################### ?> -
PostGIS check | pg_query($con,$sql)";
- if(!$res) $check .="PostGIS support | no PostGIS function available | PostGIS support | no PostGIS function available | PostGIS support | X | PostGIS function available | PostGIS support | X | PostGIS function available | Version | X | " . pg_fetch_result($res,$cnt,0). " | PostGIS support | no PostGIS function available | PostGIS support | no PostGIS function available | Postgis support | no PostGIS function available | Postgis support | no PostGIS function available | |
---|
mapbender.conf check | +Mapbender Configuration Check | Administration Database | X | " . SYS_DBTYPE . " | "; @@ -211,15 +224,15 @@ # PREPAREDSTATEMENTS if (defined('PREPAREDSTATEMENTS')){ if (PREPAREDSTATEMENTS == true){ - if (phpversion()<'5.1.0') $check.="
---|---|---|---|
PREPAREDSTATEMENTS- compatibility | PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible set PREPAREDSTATEMENTS to false or update php to >=5.1 | ||
PREPAREDSTATEMENTS- compatibility | X | set to 'true' and php " . phpversion() . " should work | |
PREPAREDSTATEMENTS | PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible set PREPAREDSTATEMENTS to false or update php to >=5.1 | ||
PREPAREDSTATEMENTS | X | set to 'true' and php " . phpversion() . " should work | |
PREPAREDSTATEMENTS- compatibility | X | set to 'false' and php " . phpversion() . " should work (but think about upgrading to php 5.1) | |
PREPAREDSTATEMENTS- compatibility | X | set to 'false' and php " . phpversion() . " should work (but you can set PREPAREDSTATEMENTS to 'true') | |
PREPAREDSTATEMENTS- compatibility | X | set to 'false' and php " . phpversion() . " should work (but think about upgrading to php 5.1) | |
PREPAREDSTATEMENTS- compatibility | X | set 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 | ||
CHARSET | X | " . CHARSET . " | |
CHARSET | CHARSET is not defined | ||
TMPDIR | X | " . TMPDIR . " | |
TMPDIR | TMPDIR is not defined | ||
OWSPROXY | X | " . OWSPROXY . " (Is this the right URL to your OWSPROXY?) | |
OWSPROXY | OWSPROXY not defined(if you want to camouflage your WMS, you should think about OWSPROXY!) | ||
AUTO_UPDATE | X | set to 1: will update all out-of-date WMS automatically | |
TIME_LIMIT | you should define a TIME_LIMIT for the AUTO_UPDATE funtionallity | ||
AUTO_UPDATE | X | set to 0: (see the result of the test and update WMS manually) | |
AUTO_UPDATE | set to " . AUTO_UPDATE . ": this configuration value is not supported(as yet!) | ||
AUTO_UPDATE | AUTO_UPDATE not defined (for the wms monitoring functionality you have to define this constant) | ||
ERROR LOGGING | X | " . $testLog->message . " | |
ERROR LOGGING | " . $testLog->message . " | ||
LOG_LEVEL | X | switched off: -no Mapbender-errors logging | |
LOG_LEVEL | X | set to 'error': -Mapbender-errors will be logged | |
LOG_LEVEL | X | set to 'warning: - Mapbender-errors and -warnings will be logged | |
LOG_LEVEL | X | set to 'all': -really every little notice will be logged!! | |
LOG_LEVEL | set to " . LOG_LEVEL . ": this configuration value is not supported (as yet!) | ||
PORTAL | X | true (Users can create theirs own accounts) | |
PORTAL | X | false (Users can't create their own accounts at the moment) | |
PORTAL | PORTAL is not defined(Maybe an old configuration file?) | ||
MAXLOGIN | X | " . MAXLOGIN . " | |
MAXLOGIN | MAXLOGIN is not defined | ||
MAXLOGIN | MAXLOGIN 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') | ";
+ if (defined('LOGIN')) $check .= "||
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) | ";
else $check .= "||
Login-Path | LOGIN is not defined | "; echo $check; - echo "||
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 |