svn commit: r62 - trunk/mapbender/http/tools

uli at osgeo.org uli at osgeo.org
Fri Apr 14 04:37:59 EDT 2006


Author: uli
Date: 2006-04-14 08:37:58+0000
New Revision: 62

Added:
   trunk/mapbender/http/tools/mapFiler.php
   trunk/mapbender/http/tools/mapbender_setup.php
   trunk/mapbender/http/tools/url_code.php

Log:
import Mapbender source without history

Added: trunk/mapbender/http/tools/mapFiler.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/tools/mapFiler.php?view=auto&rev=62
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/tools/mapFiler.php	2006-04-14 08:37:58+0000
@@ -0,0 +1,126 @@
+<html>
+  <head>
+    <title>MapFile</title>
+    <style></style>
+  <script type='text/javascript' >
+  function validate(){
+  	/*eventuell den Inhalt (Pfad) noch aufbereiten?
+	* Slash und Backslash -> win, linux usw.
+	*/
+	document.form1.location.type = 'text';
+	document.form1.myLocation.value = document.form1.location.value;
+	document.form1.submit();
+  }
+  </script>
+  </head>
+  <body>
+  <form name='form1' action='<?php $PHP_SELF ?>' method='POST'>
+  <table>
+	<tr>
+		<td>Location:</td>
+		<td>
+			<input type='file' name='location' >
+			<input type='hidden' name='myLocation'>
+		</td>
+	</tr>
+	<tr>
+		<td>all files with the same extension:</td>
+		<td>
+		<input type='checkbox' name='dir'>
+		</td>
+	</tr>
+	<tr>
+		<td>Factor:</td>
+		<td><input type='text' name='factor' value='4'></td>
+	</tr>		
+	<tr>
+		<td><input type='button' value="let's go" onclick='validate()'></td>
+		<td></td>
+	</tr>
+  </table>
+  <?php
+  
+import_request_variables('PG');
+
+/*********PARAMS***************/
+$countSymbolsFiles = 0;
+$arraySymbolsFiles;
+/********************************/
+function modify($myDir, $myFile){
+	global $factor;
+	$myContent = fopen($myDir."/".$myFile, "r") or die("Datei " . $myDir . " / ". $myFile ." konnte nicht zum Lesen geöffnet werden!");
+	$myNewContent = fopen($myDir."/".str_replace(".","_".$factor.".",$myFile), "w") or die("Datei " . $myDir . " / ". str_replace(".","_".$factor.".",$myFile) ." konnte nicht zum Schreiben geöffnet werden!");
+	fputs($myNewContent, "#Modified by MapbenderTools" . "\n");
+	fputs($myNewContent, "#Date: ". date("d.m.Y") . "\n");
+	fputs($myNewContent, "#Factor: ". $factor . "\n\n");
+                
+	while(!feof($myContent)){
+		$myLine = fgets($myContent, 1024);
+		if(preg_match("/\bSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
+			if(count($matches) <= 2){ 
+				fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
+			}
+		}
+		else if(preg_match("/(.*OFFSET)\s*(\d+.?\d*)(\s*)(\d+.?\d*)(\s*)/i",$myLine,$matches)){
+			$myNewOFFSET=$matches[1] . " " .multiplicate($matches[2]) . " " . multiplicate($matches[4]).$matches[5];
+			fputs($myNewContent,$myNewOFFSET);
+		}
+		else if(preg_match("/\bMAXSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
+			if(count($matches) <= 2){ 
+				fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
+			}
+		} 
+		else if(preg_match("/\bMINSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
+			if(count($matches) <= 2){ 
+				fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
+			}
+		}                       
+		else if(preg_match("/\bSYMBOLSCALE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){ 
+			fputs($myNewContent, "# ". $myLine);
+		}                       
+		else if(preg_match("/\bSYMBOLSET\s*(.*)/i",$myLine,$matches)){ //noch nicht fertig
+			$arraySymbolFiles[$countSymbolsFiles] = str_replace("\"","",$matches[1]);
+			$countSymbolsFiles++;
+			fputs($myNewContent, $myLine);
+		}
+		#catch all
+		else{
+			fputs($myNewContent, $myLine);
+		}        
+	}
+	fclose($myContent);
+	fclose($myNewContent);
+}
+function multiplicate($x){
+	global $factor;
+	$x = floatval($x) * $factor;
+	return $x;
+}
+
+ if(isset($myLocation) && $myLocation != ""){
+	# what is to do...
+	$myFile = basename($myLocation);
+	$myDir = dirname($myLocation);
+	$suffix = strstr($myFile, ".");
+
+	
+	if(!isset($dir)){
+		modify($myDir, $myFile);
+		echo "modified: " . $myDir . "/" . $myFile. "<br />";
+	}
+	else{
+		if($verz = opendir($myDir)){
+			while ($myFile = readdir ($verz)) {
+				if($myFile != ".." && $myFile != "." && is_file($myDir."/".$myFile) && strstr($myFile, $suffix)){
+					modify($myDir, $myFile);                         
+					echo "modified: " . $myDir . "/" . $myFile. "<br />";
+				}
+			}
+			closedir($verz);
+		}
+	}
+} 
+  ?>  
+  </form>
+  </body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/tools/mapbender_setup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/tools/mapbender_setup.php?view=auto&rev=62
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/tools/mapbender_setup.php	2006-04-14 08:37:58+0000
@@ -0,0 +1,112 @@
+<?php
+#$Id: mapbender_setup.php,v 1.5 2006/02/06 07:50:25 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/tools/mapbender_setup.php,v 1.5 2006/02/06 07:50:25 astrid_emde Exp $
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Mapbender Setup</title>
+</head>
+<body>
+<h3> Mapbender Setup</h3>
+<table border='1'>
+<?php
+
+
+include_once("../../conf/mapbender.conf");
+$con = @db_connect(DBSERVER,OWNER,PW);
+
+db_select_db(DB,$con);
+
+if (SYS_DBTYPE=="mysql"){
+	echo "<tr bgcolor='#ffffe0'><td>Administration Database</td><td>Connect to Database</td><td>PostGIS support</td></tr>";
+	echo "<tr><td>MySQL</td><td>";
+	if($con){echo "on";}
+	else{echo "off";}
+	echo "</td>";
+	echo "<td>";
+	
+	$con_string = "host=$GEOS_DBSERVER port=$GEOS_PORT dbname=$GEOS_DB user=$GEOS_OWNER password=$GEOS_PW";
+	
+	$con_postgis = pg_connect($con_string);
+	
+	if($con_postgis){
+		$sql = "Select postgis_version();";
+	    $res = pg_query($con_postgis,$sql);
+		if(!$res){
+			echo "<td>no PostGIS support</td>";
+		}else{
+			$cnt=0;
+			while(pg_fetch_row($res)){
+	  	 		echo "Version: ". pg_fetch_result($res,$cnt,0)."</td>";
+	     		$cnt++;
+			}
+			if ($cnt==0){
+				echo "<td>no PostGIS support</td>";
+			}
+		}
+	}else{
+		echo "<td> no connect</td>";
+	}
+	echo "</td>";
+	echo "</table>";
+}else{
+	echo "<tr bgcolor='#d4d3d3'><td>Administration Database</td><td>Connect to Database</td><td>PostGIS support</td><td>md5</td></tr>";
+	echo "<tr><td>PostgreSQL</td><td>";
+	if($con){echo "on";}
+	else{echo "off";}
+	echo "</td>";
+
+	
+	echo "</td>";
+	if($con){
+		$sql = "Select postgis_version();";
+		$res = @db_query($sql);
+		if(!$res){
+			echo "<td>no PostGIS support</td>";
+		}else{
+			$row = db_fetch_array($res);
+			if ($row) {
+				echo "<td>on: VERSION ". $row[0]."</td>";
+			}else{
+				echo "<td>no PostGIS support</td>";
+			}
+		}
+		# md5 support
+		
+		$sql = "Select md5('root');";
+		$res = @db_query($sql);
+		if(!$res){
+			echo "<td>no md5 support</td>";
+		}else{
+			$row = db_fetch_array($res);
+			if ($row) {
+				echo "<td>md5 support</td>";
+			}else{
+				echo "<td>no md5 support</td>";
+			}
+		}
+
+	}else{
+		echo "<td> no connect</td>";
+		echo "<td> no connect</td>";
+	}
+	echo "</tr>";
+
+	echo "</table>";
+}
+
+echo "<br>File to start Mapbender: ";
+$path = LOGIN;
+echo "<a href='".$path."'>".$path."</a>";
+
+?>
+
+</body>
+</html>

Added: trunk/mapbender/http/tools/url_code.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/tools/url_code.php?view=auto&rev=62
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/tools/url_code.php	2006-04-14 08:37:58+0000
@@ -0,0 +1,26 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Url-Encode and -Decode</title>
+</head>
+<body>
+<form method='POST'>
+  <textarea name="c" rows="10" cols="100"><?php  if($_REQUEST["c"]){echo $_REQUEST["c"];}?></textarea>
+  <br>
+  <input type='submit' name='encode' value='encode'>
+  <br>
+  <input type='submit' name='decode' value='decode'>  
+</form>
+<hr>
+<textarea rows="10" cols="100">
+<?php
+if($_REQUEST["encode"]){
+echo urlencode($_REQUEST["c"]);
+}
+if($_REQUEST["decode"]){
+echo urldecode($_REQUEST["c"]);	
+}
+?>
+</textarea>
+</body>
+</html>
\ No newline at end of file




More information about the Mapbender_commits mailing list