[Mapbender-commits] r10374 - in trunk/mapbender/http: classes sld

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 18 00:00:25 PST 2019


Author: armin11
Date: 2019-12-18 00:00:24 -0800 (Wed, 18 Dec 2019)
New Revision: 10374

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/sld/sld_parse.php
Log:
Little fix and initial option to integrate sld editor again?

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2019-12-17 13:03:45 UTC (rev 10373)
+++ trunk/mapbender/http/classes/class_iso19139.php	2019-12-18 08:00:24 UTC (rev 10374)
@@ -718,7 +718,6 @@
 		if ($metadataConnector->timedOut == true) {
 			return false;
 		}
-		$xml = $metadataConnector->file;
 		$mbMetadata = $this->createMapbenderMetadataFromXML($xml);
 		return $mbMetadata;
 	}
@@ -728,7 +727,6 @@
 		$metadataConnector = new connector();
 		$metadataConnector->set("timeOut", "10");
 		$metadataConnector->load($url);
-		//
 		$xml = $metadataConnector->file;
 		$this->metadata = $xml;
 	}

Modified: trunk/mapbender/http/sld/sld_parse.php
===================================================================
--- trunk/mapbender/http/sld/sld_parse.php	2019-12-17 13:03:45 UTC (rev 10373)
+++ trunk/mapbender/http/sld/sld_parse.php	2019-12-18 08:00:24 UTC (rev 10374)
@@ -1,5 +1,5 @@
 <?php
-# $Id: sld_parse.php 2412 2008-04-23 16:14:30Z christoph $
+# $Id$
 # http://www.mapbender.org/index.php/SLD/sld_config.php
 # Copyright (C) 2002 CCGIS 
 #
@@ -32,9 +32,8 @@
  * @package sld_parse
  * @author Markus Krzyzanowski
  */
-
-//require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_connector.php");
 /**
  *  Creates a empty SLD object up to the rule object
  * 
@@ -65,21 +64,14 @@
  * @param string $file URL of the file
  * @return string content of the file
  */
-function readSld($file)
-{
-	if (!($fp = fopen($file, "rb")))
-	{
-		die("could not open XML input - ".$file);
-	}
-	
-	$data = "";
-	
-	while(!feof($fp))
-	{
-		$data .= fread($fp, 1024);
-
-	}
-	return $data;
+function readSld($url) {
+    $sldConnector = new connector();
+    $sldConnector->set("timeOut", "5");
+    $sldConnector->load($url);
+    if ($sldConnector->timedOut == true) {
+        return false;
+    }
+    return $sldConnector->file;
 }
 
 /**



More information about the Mapbender_commits mailing list