[Mapbender-commits] r10057 - in trunk/mapbender: conf http/classes lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Feb 18 03:49:44 PST 2019


Author: armin11
Date: 2019-02-18 03:49:44 -0800 (Mon, 18 Feb 2019)
New Revision: 10057

Modified:
   trunk/mapbender/conf/mapbender.conf-dist
   trunk/mapbender/http/classes/class_connector.php
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/lib/class_Monitor.php
Log:
New possibility to define timeout for capabilities monitoring seperately

Modified: trunk/mapbender/conf/mapbender.conf-dist
===================================================================
--- trunk/mapbender/conf/mapbender.conf-dist	2019-02-17 20:41:01 UTC (rev 10056)
+++ trunk/mapbender/conf/mapbender.conf-dist	2019-02-18 11:49:44 UTC (rev 10057)
@@ -181,6 +181,10 @@
 # --------------------------------------------
 define("NOTIFY_ON_UPDATE",true);
 
+# --------------------------------------------
+# Define special TIMEOUT for Capabilities Monitoring in seconds - default is defined in class_connector and is set to 20
+# --------------------------------------------
+#define("CAP_MONITORING_TIMEOUT", "30");
 
 # --------------------------------------------
 # RSS

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2019-02-17 20:41:01 UTC (rev 10056)
+++ trunk/mapbender/http/classes/class_connector.php	2019-02-18 11:49:44 UTC (rev 10057)
@@ -28,7 +28,7 @@
 
 	var $file;
 	private $connectionType;
-	public $timeOut = 20;
+	public  $timeOut = 20;
 	private $httpType = "get";
 	private $httpVersion = "1.0";
 	private $httpPostData;

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2019-02-17 20:41:01 UTC (rev 10056)
+++ trunk/mapbender/http/classes/class_iso19139.php	2019-02-18 11:49:44 UTC (rev 10057)
@@ -671,8 +671,10 @@
 		} else {
 			$this->linkAlreadyInDB = true;
 		}
-		$metadataConnector = new connector($url);
+		$metadataConnector = new connector();
 		$metadataConnector->set("timeOut", "5");
+		$metadataConnector->load($url);
+		$xml = $metadataConnector->file;
 		if ($metadataConnector->timedOut == true) {
 			return false;
 		}
@@ -683,8 +685,10 @@
 
 	public function readFromUrl($url){
 		$this->href = $url;
-		$metadataConnector = new connector($url);
+		$metadataConnector = new connector();
 		$metadataConnector->set("timeOut", "10");
+		$metadataConnector->load($url);
+		//
 		$xml = $metadataConnector->file;
 		$this->metadata = $xml;
 	}

Modified: trunk/mapbender/lib/class_Monitor.php
===================================================================
--- trunk/mapbender/lib/class_Monitor.php	2019-02-17 20:41:01 UTC (rev 10056)
+++ trunk/mapbender/lib/class_Monitor.php	2019-02-18 11:49:44 UTC (rev 10057)
@@ -92,10 +92,14 @@
 		}
 		if ($this->capabilitiesURL) {
 			$this->timestamp_cap_begin=microtime(TRUE);//ok
+			$capObject = new connector();
+			if (defined("CAP_MONITORING_TIMEOUT") && CAP_MONITORING_TIMEOUT !== "") {
+				$capObject->set("timeOut", CAP_MONITORING_TIMEOUT);
+			}
 			if (isset($auth)) {
-				$capObject = new connector($this->capabilitiesURL,$auth);
+				$capObject->load($this->capabilitiesURL,$auth);
 			} else {
-				$capObject = new connector($this->capabilitiesURL);
+				$capObject->load($this->capabilitiesURL);
 			}
 			$this->remoteXML = $capObject->file;
 			//encode all into utf-8 to compare them - this is done in too when storing the caps into the database after parsing the caps



More information about the Mapbender_commits mailing list