[Mapbender-commits] r1660 - trunk/mapbender/http/tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 13 12:21:51 EDT 2007


Author: marko
Date: 2007-08-13 12:21:51 -0400 (Mon, 13 Aug 2007)
New Revision: 1660

Modified:
   trunk/mapbender/http/tools/mapbender_setup.php
Log:
little arangement changes and new checks for auto_update,log_level ...

Modified: trunk/mapbender/http/tools/mapbender_setup.php
===================================================================
--- trunk/mapbender/http/tools/mapbender_setup.php	2007-08-10 12:09:59 UTC (rev 1659)
+++ trunk/mapbender/http/tools/mapbender_setup.php	2007-08-13 16:21:51 UTC (rev 1660)
@@ -31,11 +31,11 @@
 	<meta http-equiv="pragma" content="no-cache">
 	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
 	<meta name="robots" content="noindex,nofollow">
-	<title>Mapbender Setupchecker</title>
+	<title>Mapbender Setup-Checker</title>
 </head>
 <link rel="stylesheet" type="text/css" href="../css/mapbender.css">
 <body>
-<table  BGCOLOR="#ffffff" width="70%" height="70%" ALIGN="top" CELLSPACING="0" CELLPADDING="10" STYLE="-moz-border-radius:8px; border:2px #000000 solid;">
+<table  BGCOLOR="#ffffff" width="95%" height="95%" ALIGN="center" CELLSPACING="0" CELLPADDING="10" STYLE="-moz-border-radius:8px; border:2px #000000 solid;">
 <tr><td VALIGN="center" STYLE="margin-bottom:0px; padding-bottom:0px;">
 <H1 style="padding:0px; margin:0px; font:32px/32px bold Arial,Helvetica,sans-serif; font-stretch:extra-expanded;font-weight:bold">
 <font align="left"" style="font-weight:bold" color="#000000">&nbsp;Ma</font><font color="#0000CE" style="font-weight:bold">p</font><font color="#C00000">b</font><font color="#000000" style="font-weight:bold">ender</font>
@@ -74,9 +74,14 @@
 	if (get_cfg_var('memory_limit')) $check .="<tr ><td>memory Limit</td><td>X</td><td><font color=#00D000>" . get_cfg_var('memory_limit') . "</font><font color='#0000FF'> (running in memory-trouble with printing? Perhaps raise your memory limit)</font></td></tr>";
 	else $check .="<tr ><td>memory Limit</td><td></td><td><font color=#FF0000>memory_limit must be set (30M will be enough for the moment)</font></td></tr>";
 # 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 .="<tr ><td>error-reporting</td>";
-	 if (get_cfg_var('error_reporting')!=2039) $check .="<td></td><td><font color=#FF0000>please set error_reporting to 'E_ALL & ~E_NOTICE' except for testing</td></tr>";
-	 else $check .="<td>X</td><td><font color=#00D000>ok, error_reporting = E_ALL & ~E_NOTICE </td></tr>";
+	 if (get_cfg_var('error_reporting')==6143||get_cfg_var('error_reporting')==8) $check .="<td></td><td><font color=#FF0000>please set error_reporting to 'E_ALL & ~E_NOTICE' or 'E_ERROR' except for debugging</td></tr>";
+	elseif  (get_cfg_var('error_reporting')==6135)$check .="<td>X</td><td><font color=#00D000>ok, error_reporting = E_ALL & ~E_NOTICE</td></tr>";
+	elseif  (get_cfg_var('error_reporting')==1)$check .="<td>X</td><td><font color=#00D000>ok, error_reporting = E_ERROR</td></tr>";
+	else $check .="<td></td><td><font color=#0000FF>(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)</td></tr>";
 # session.save_handler
 	if (!get_cfg_var('session.save_handler')||get_cfg_var('session.save_handler')!='files') $check .="<tr ><td>session.save_handler</td><td></td><td><font color=#FF0000>session.save_handler must be set to 'session.save_handler = files'!</font></td></tr>";
 	else $check .="<tr ><td>session.save_handler</td><td>X</td><td><font color=#00D000>session.save_handler = " . get_cfg_var('session.save_handler') . "</font></td></tr>"; 
@@ -92,31 +97,28 @@
 #################################################
 #PHP Extensioncheck
 #################################################
-#MYSQL
 	?>
-	</table>
-	<br><br>
-	<table style="border: 2px solid rgb(128, 128, 128); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;" bgcolor=#dddddd cellspacing=0 cellpadding=0 width="95%">
 	<th colspan="3" bgcolor=#F0F0F0>PHP Extensioncheck</th>
 	<?php
+#MYSQL	
 	if(!extension_loaded('mysql')) $check="<tr ><td width=\"25%\">MySQL check</td><td width=\"10\"></td><td><font color=#FF0000 >MySQL not installed! (You have to include mysql-extension if you want to use MySQL as MB-Database!)</font></td></tr>";
 	else $check="<tr ><td width=\"25%\">MySQL check</td><td width=\"10\">X</td><td><font color=#00D000 >MySQL installed</font></td></tr>";
 #PGSQL
 	if(!extension_loaded('pgsql')) $check.="<tr><td>PostgreSQL check</td><td></td><td><font color=#FF0000>PostgreSQL not installed (You have to include pgsql-extension if you want to use Postgres as MB-Database!)</font></td></tr>";
 	else $check.="<tr><td>PostgreSQL check</td><td>X</td><td><font color=#00D000>PostgreSQL installed</font></td></tr>";
-#GD2
-	if(extension_loaded('gd')) $check.="<tr ><td>GD check</td><td>X</td><td><font color=#00D000>GD installed</font></td></tr>";
-	else $check.="<tr ><td>GD check</td><td></td><td><font color=#FF0000>GD not installed (no printing possible)</font></td></tr>";
+#GD
+	if(extension_loaded('gd')) $check.="<tr ><td>GD2 check</td><td>X</td><td><font color=#00D000>GD installed</font></td></tr>";
+	else $check.="<tr ><td>GD2 check</td><td></td><td><font color=#FF0000>GD not installed (no printing possible)</font></td></tr>";
 
 #mbstring
 	if(extension_loaded('mbstring')) $check.="<tr ><td>mbstring check</td><td>X</td><td><font color=#00D000>mbstring installed</font></td></tr>";
 	else $check.="<tr ><td>mbstring check</td><td></td><td><font color=#FF0000>PHP extension mbstring is not installed</font></td></tr>";
-	
+
 #gettext
 	if(extension_loaded('gettext')) $check.="<tr ><td>gettext check</td><td>X</td><td><font color=#00D000>gettext installed</font></td></tr>";
 	else $check.="<tr ><td>gettext check</td><td></td><td><font color=#FF0000>PHP extension gettext is not installed</font></td></tr>";
-	
-	echo $check;	
+
+echo $check;	    
 ####################################
 # Database check
 ####################################
@@ -139,22 +141,22 @@
 			$con_postgis = pg_connect($con_string);
 			$sql = "Select postgis_full_version();";
 			$res = pg_query($con_postgis,$sql);
-			if(!$res) $check .="<tr width=\"20%\><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</tr>";
+			if(!$res) $check .="<tr width=\"20%\><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			else{
 				$cnt=0;
 				while(pg_fetch_row($res)){
-					$check .="<tr><td>PostGIS support</td><td>X</td><td><font color=#00D000>PostGIS function available</tr>";
+					$check .="<tr><td>PostGIS support</td><td>X</td><td><font color=#00D000>PostGIS function available</td></tr>";
 					$check .="<tr><td>Version</td><td>X</td><td><font color=#00D000>" . pg_fetch_result($res,$cnt,0). "</td></tr>";
 		  		  	$cnt++;
 		  		}
-				if ($cnt==0) $check .="<tr><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</tr>";
+				if ($cnt==0) $check .="<tr><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			}
 		}
-		else $check .="<tr><td>Postgis support</td><td></td><td><font color=#FF0000>no PostGIS function available</font></tr>";
+		else $check .="<tr><td>Postgis support</td><td></td><td><font color=#FF0000>no PostGIS function available</font></td></tr>";
 		echo $check;
 	}
 	else{
-		$check = "<tr><td width=\"25%\">Administration Database</td><td>X</td><td><font color=#00D000>PostgreSQL</td><tr>";
+		$check = "<tr><td width=\"25%\">Administration Database</td><td>X</td><td><font color=#00D000>PostgreSQL</td></tr>";
 		$check .= "<tr><td>Connect to Database</td>";
 		if($con) $check .="<td width=\"10\">X</td><td><font color=#00D000>connected</font></td></tr>";
 		else $check .="<td width=\"10\"></td><td><font color=#FF0000>not connected</font></td></tr>";
@@ -172,9 +174,6 @@
 # PostGIS check
 ######################################	
 	?>
-	</table>
-	<br><br>
-	<table style="border: 2px solid rgb(128, 128, 128); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;" bgcolor=#dddddd cellspacing=0 cellpadding=0 width="95%">
 	<th colspan="3" bgcolor=#F0F0F0>PostGIS check</th>
 	<?php
 		$check ="";
@@ -182,18 +181,18 @@
 			$sql = "select postgis_full_version();";
 			if (pg_query($con,$sql))$res = pg_query($con,$sql);
 			else echo "<tr><td><font>pg_query($con,$sql)";
-			if(!$res) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</tr>";
+			if(!$res) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			else{
 				$cnt=0;
 				while(pg_fetch_row($res)){
-					$check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\">X</td><td><font color=#00D000>PostGIS function available</tr>";
+					$check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\">X</td><td><font color=#00D000>PostGIS function available</td></tr>";
 					$check .="<tr><td>Version</td><td width=\"10\">X</td><td><font color=#00D000>" . pg_fetch_result($res,$cnt,0). "</td></tr>";
 		  		  	$cnt++; 	
 		  		}
-				if ($cnt==0) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</tr>";
+				if ($cnt==0) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			}
 		}
-		else $check .="<tr><td width=\"25%\">Postgis support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</font></tr>";
+		else $check .="<tr><td width=\"25%\">Postgis support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</font></td></tr>";
 		echo $check;
 	} 
 #################################
@@ -203,7 +202,7 @@
 	</table>
 	<br><br>
 	<table style="border: 2px solid rgb(128, 128, 128); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;" bgcolor=#dddddd cellspacing=0 cellpadding=0 width="95%">
-	<th colspan="3" bgcolor=#F0F0F0>mapbender.conf check</th>
+	<th colspan="4" bgcolor=#F0F0F0>Mapbender Configuration Check</th>
 	<?php 
 # SYS_DBTYPE
 	if ((SYS_DBTYPE == 'mysql' || SYS_DBTYPE == 'pgsql') && defined('SYS_DBTYPE')) $check ="<tr><td>Administration Database</td><td >X</td><td><font color=#00D000>" . SYS_DBTYPE . "</font></td></tr>";
@@ -220,29 +219,56 @@
 # PREPAREDSTATEMENTS
 	if (defined('PREPAREDSTATEMENTS')){
 		if (PREPAREDSTATEMENTS == true){
-			if (phpversion()<'5.1.0') $check.="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\"></td><td><font color=\"#ff0000\">PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible<br>set PREPAREDSTATEMENTS to false or update php to >=5.1</td></tr>";
-			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'true' and php " . phpversion() . " should work</td><tr/>";
+			if (phpversion()<'5.1.0') $check.="<tr><td width=\"25%\">PREPAREDSTATEMENTS</td><td width=\"10\"></td><td><font color=\"#ff0000\">PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible<br>set PREPAREDSTATEMENTS to false or update php to >=5.1</td></tr>";
+			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS</td><td width=\"10\">X</td><td><font color=#00D000>set to 'true' and php " . phpversion() . " should work</td></tr>";
 		}
 		else{
-			if (phpversion()<'5.1.0') $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work </font><font color='#0000FF'> (but think about upgrading to php 5.1)</td><tr/>";
-			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work <font color=#0000FF>(but you can set PREPAREDSTATEMENTS to 'true')</font></td><tr/>";
+			if (phpversion()<'5.1.0') $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work </font><font color='#0000FF'> (but think about upgrading to php 5.1)</td></tr>";
+			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work <font color=#0000FF>(but you can set PREPAREDSTATEMENTS to 'true')</font></td></tr>";
 		}
 	}
-    else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\"></td><td><font color=#FF0000>PREPAREDSTATEMENTS is not defined</td><tr/>";
+    else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\"></td><td><font color=#FF0000>PREPAREDSTATEMENTS is not defined</td></tr>";
 # CHARSET
 	if (CHARSET != "" && defined('CHARSET')) $check .="<tr><td>CHARSET</td><td>X</td><td><font color=#00D000>" . CHARSET . "</font><font color='#0000FF'></font></td></tr>";
 	else $check .="<tr><td>CHARSET</td><td></td><td><font color=#FF0000>CHARSET is not defined</font></td></tr>";
 # TMPDIR
 	if (TMPDIR != "" && defined('TMPDIR')) $check .="<tr><td>TMPDIR</td><td>X</td><td><font color=#00D000>" . TMPDIR . "</font><font color='#0000FF'></font></td></tr>";
 	else $check .="<tr><td>TMPDIR</td><td></td><td><font color=#FF0000>TMPDIR is not defined</font></td></tr>";
+# OWSPROXY
+	if (OWSPROXY != "" && defined('OWSPROXY')) $check .="<tr><td>OWSPROXY</td><td>X</td><td><font color=#00D000>" . OWSPROXY . "</font><font color=#0000FF> (Is this the right URL to your OWSPROXY?)</font></td></tr>";
+	else $check .="<tr><td>OWSPROXY</td><td></td><td><font color=#FF0000>OWSPROXY not defined</font><font color=#0000FF>(if you want to camouflage your WMS, you should think about OWSPROXY!)</font></td></tr>";
+#AUTO_UPDATE
+	if (AUTO_UPDATE != "" && defined('AUTO_UPDATE')){
+		if (AUTO_UPDATE == '1'){ 
+			$check .="<tr><td>AUTO_UPDATE</td><td>X</td><td>set to 1: will update all out-of-date WMS automatically<td></tr>";
+			if (!TIME_LIMIT || TIME_LIMIT == "")$check .="<tr><td>TIME_LIMIT</td><td></td><td><font color=#FF0000>you should define a TIME_LIMIT for the AUTO_UPDATE funtionallity</font><td></tr>";
+		}
+		elseif (AUTO_UPDATE == '0') $check .="<tr><td>AUTO_UPDATE</td><td>X</td><td><font color=#00D000>set to 0:</font> <font color=#0000FF>(see the result of the test and update WMS manually)</font></td></tr>";
+		else $check .="<tr><td>AUTO_UPDATE</td><td></td><td><font color=#FF0000>set to " . AUTO_UPDATE . ": this configuration value is not supported(as yet!)</td></tr>";
+	} 			    	
+	else $check .="<tr><td>AUTO_UPDATE</td><td></td><td><font color=#FF0000>AUTO_UPDATE not defined </font><font color=#0000FF>(for the wms monitoring 	functionality you have to define this constant)</font></td></tr>";
+#LOG_LEVEL (off,error,warning,all)
+	if (LOG_LEVEL !="" && defined('LOG_LEVEL')){
+		if (LOG_LEVEL =='off') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td>switched off: <font color=#FF0000>-no Mapbender-errors logging</font><td></tr>"; 
+		elseif (LOG_LEVEL =='error') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'error': </font><font color=#0000FF>-Mapbender-errors will be logged</font><td></tr>";
+		elseif (LOG_LEVEL =='warning') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'warning: </font><font color=#0000FF>- Mapbender-errors and -warnings will be logged</font><td></tr>";
+		elseif (LOG_LEVEL =='all') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'all': </font><font color=#0000FF>-really every little notice will be logged!!</font><td></tr>";
+		else $check .="<tr><td>LOG_LEVEL</td><td></td><td><font color=#FF0000>set to " . LOG_LEVEL . ": this configuration value is not supported (as yet!)</font></td></tr>";		
+	}	
+# PORTAL
+	if (defined('PORTAL')){
+		if (PORTAL == true) $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\">X</td><td><font color=#00D000>true</font><font color='#0000FF'> (Users can create theirs own accounts)</font></td></tr>";
+		else $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\">X</td><td><font color=#00D000>false<font color=#0000FF> (Users can't create their own accounts at the moment)</font></td></tr>";
+	}
+    else $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\"></td><td><font color=#FF0000>PORTAL is not defined<font color=#0000FF>(Maybe an old configuration file?)</font></td></tr>";
 # MAXLOGIN
 	if (MAXLOGIN != "" && defined('MAXLOGIN')) $check .="<tr><td>MAXLOGIN</td><td>X</td><td><font color=#00D000>" . MAXLOGIN . "</font><font color='#0000FF'></font></td></tr>";
-	else $check .="<tr><td>MAXLOGIN</td><td></td><td><font color=#FF0000>MAXLOGIN is not defined</font></td></tr>";		    	
+	else $check .="<tr><td>MAXLOGIN</td><td></td><td><font color=#0000FF>MAXLOGIN is not defined</font></td></tr>";		    	
 # LOGIN
-	if (defined('LOGIN')) $check .= "<tr height=10/><tr><td>Login-Path</td><td colspan=2><a href='" . LOGIN . "' target='_blank'>" . LOGIN . "</a><br><font color=#0000FF> (if this link doesn't work, check out your 'URL to Login' in your mapbender.conf<br>Perhaps an alias in your httpd.conf will solve the prob')</td>";
+	if (defined('LOGIN')) $check .= "<tr height=10/><tr><td>Login-Path</td><td colspan=2><a href='" . LOGIN . "' target='_blank'>" . LOGIN . "</a><br><font color=#0000FF> (If this link doesn't work, check your url to 'Login' in your mapbender.conf<br>Perhaps an alias in your httpd.conf will solve the problem, too)</td>";
 	else $check .= "<tr height=10/><tr><td>Login-Path</td><td colspan=2><font color=#FF0000>LOGIN is not defined</font></td>";
 	echo $check;	
-	echo "<tr height=10/><tr bgcolor=#F0F0F0><td colspan=3>Legend:<br><font color=#FF0000>red = maybe your Mapbender will run into trouble</font><br><font color=#0000FF>blue = just a tip</font><br><font color=#00D000>green = seems to be alright</font></td></tr>";
+	echo "<tr height=10/><tr bgcolor=#F0F0F0><td colspan=4>Legend:<br><font color=#FF0000>red = maybe your Mapbender will run into trouble</font><br><font color=#0000FF>blue = just a tip</font><br><font color=#00D000>green = seems to be alright</font></td></tr>";
 	echo "</table>";
 	echo "<tr><td colspan=3 align=right>for further informations visit <a href=\"http://www.mapbender.org/index.php/Installation_en\" target=\"_blank\"><font align=\"left\" style=\"font-weight:bold\" color=\"#000000\">&nbsp;Ma</font><font color=\"#0000CE\" style=\"font-weight:bold\">p</font><font color=\"#C00000\" style=\"font-weight:bold\">b</font><font color=\"#000000\" style=\"font-weight:bold\">ender</font> installation instructions</a></td></tr>";
 	?>



More information about the Mapbender_commits mailing list