svn commit: r875 - trunk/mapbender/http/extensions/geom2wfst.php

christoph at osgeo.org christoph at osgeo.org
Mon Nov 20 09:44:20 EST 2006


Author: christoph
Date: 2006-11-20 14:44:19+0000
New Revision: 875

Modified:
   trunk/mapbender/http/extensions/geom2wfst.php

Log:
* include via dirname(__FILE__)
* check if filepointer is valid
* removed error message

Modified: trunk/mapbender/http/extensions/geom2wfst.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/extensions/geom2wfst.php?view=diff&rev=875&p1=trunk/mapbender/http/extensions/geom2wfst.php&p2=trunk/mapbender/http/extensions/geom2wfst.php&r1=874&r2=875
==============================================================================
--- trunk/mapbender/http/extensions/geom2wfst.php	(original)
+++ trunk/mapbender/http/extensions/geom2wfst.php	2006-11-20 14:44:19+0000
@@ -20,7 +20,6 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
 echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
 ?>
 <title>Test WFS-T operated by CCGIS</title>
@@ -57,7 +56,6 @@
 xml_parser_free($parser);
 	
 $section;
-$error=true;
 $result="";
 foreach ($values as $element) {
 	$element[tag] = sepNameSpace($element[tag]);
@@ -85,14 +83,11 @@
 	#echo "wfsWindow.document.getElementsByTagName('body')[0].innerHTML = '".addslashes($result)."';";
 	#echo "wfsWindow.document.close();";
 	echo $result;
-	$e = new mb_exception('WFS error at: host: '.$host.' port: '.$port.' filter: '.$_REQUEST["filter"].' - error message: '.$result);
 	echo "<script language='javascript'>";
 	echo "window.focus();";
-	echo "alert('An error has occured.');\n";
 	echo "</script>";
 }
 else {
-	#$e = new mb_exception('WFS successfull host: '.$host.' port: '.$port.' filter: '.$_REQUEST["filter"]);
 	echo "<script language='javascript'>";
 	echo "window.opener.alert('".$result."');\n";
 	echo "window.opener.focus();";
@@ -117,25 +112,19 @@
     }
     $method = strtoupper($method);
     $fp = fsockopen($host, $port);
-    if (!$fp) {
-		echo "$errstr ($errno)<br/>\n";
-		echo $fp;
-	} 
-	else {
-    	fputs($fp, "$method $path HTTP/1.1\r\n");
-    	fputs($fp, "Host: $host\r\n");
-    	fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
-    	fputs($fp, "Content-length: " . strlen($data) . "\r\n");
-    	fputs($fp, "Connection: close\r\n\r\n");
-    	if ($method == 'POST') {
-	        fputs($fp, $data);
-	    }
-
-    	while (!feof($fp)) {
-        	$buf .= fgets($fp,4096);
-    	}
-    	fclose($fp);
-	}
+    fputs($fp, "$method $path HTTP/1.1\r\n");
+    fputs($fp, "Host: $host\r\n");
+    fputs($fp,"Content-type: application/x-www-form-urlencoded\r\n");
+    fputs($fp, "Content-length: " . strlen($data) . "\r\n");
+    fputs($fp, "Connection: close\r\n\r\n");
+    if ($method == 'POST') {
+        fputs($fp, $data);
+    }
+
+    while (!feof($fp)) {
+        $buf .= fgets($fp,4096);
+    }
+    fclose($fp);
     return $buf;
 }
 ?>




More information about the Mapbender_commits mailing list