[Mapbender-commits] r1503 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jul 18 09:25:31 EDT 2007


Author: christoph
Date: 2007-07-18 09:25:31 -0400 (Wed, 18 Jul 2007)
New Revision: 1503

Removed:
   trunk/mapbender/http/php/mod_monitorCapabilities.php
Log:
replaced by mod_monitorCapabilities_main

Deleted: trunk/mapbender/http/php/mod_monitorCapabilities.php
===================================================================
--- trunk/mapbender/http/php/mod_monitorCapabilities.php	2007-07-17 09:39:12 UTC (rev 1502)
+++ trunk/mapbender/http/php/mod_monitorCapabilities.php	2007-07-18 13:25:31 UTC (rev 1503)
@@ -1,132 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Monitor_Capabilities
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-session_start();
-import_request_variables("PG");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Monitor WMS Capabilities</title>
-<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
-</head>
-<body>
-<?php
-require_once(dirname(__FILE__)."/../classes/class_wms.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
-$admin = new administration();
-$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
-$permguis = $admin->getGuisByPermission($_SESSION["mb_user_id"],true);
-$wms_id_own = $admin->getWmsByOwnGuis($ownguis);
-
-set_time_limit(0);
-
-echo "Starting monitoring cycle...<br><br>";
-echo "WMS services are requested for availabiltiy. "; 
-echo "Capabilities documents are requested and all changes synchronized with the database cache.<br><br>";
-echo "<table cellspacing=10 cellpadding = 8 border = 1>";
-for ($k=0; $k<count($wms_id_own); $k++) {
-	$wmsId = $wms_id_own[$k];
-	echo "<tr><td><b>Processing WMS</b> (ID = " . $wmsId . ")<br>";
-	// get the wms version, capabilities, capabilities_doc
-	$sql = "SELECT wms_title, wms_version, wms_getcapabilities, wms_getcapabilities_doc ";
-	$sql .= "FROM wms WHERE wms_id = $1";
-	$v = array($wmsId);
-	$t = array('i');
-	$res = db_prep_query($sql,$v,$t);
-	$someArray = db_fetch_row($res);
-	$wms_title = $someArray[0];
-	$version = $someArray[1];
-	$capabilities = $someArray[2]; 	
-	$capabilities_doc = $someArray[3];
-	echo "WMS Title: <b><i>" . $wms_title . "</i></b><br>";
-	// construct capabilities URL
-	if ($version == "1.1.1" || $version == "1.1.0") {
-		$myURL = $capabilities . "REQUEST=GetCapabilities&SERVICE=wms&VERSION=" . $version;	
-	}
-	elseif ($version == "1.0.0" ) {
-		$myURL = $capabilities . "REQUEST=capabilities&WMTVER=1.0.0";
-	}
-	else {
-		echo "Version '" . $version . "' cannot be handled! Update process terminated.</td><td><img src ='../img/trafficlights/stop.bmp'></td></tr>";
-	}
-	if (($version == "1.1.1" || $version == "1.1.0" ||$version == "1.0.0") && $myURL) {
-		// compare the capabilities XML documents
-		$localXml = $capabilities_doc;
-		set_time_limit(300);
-		echo "<a href='" . $myURL . "'>Get Capabilities Link</a><br>";
-		$x = new connector($myURL);
-		$z = new wms();
-		$remoteXml = $z->char_encode($x->file);
-
-//		$remoteXml = implode("", file($myURL));
-//		$localXmlArray = explode("\n", $localXml);
-//		$remoteXmlArray = explode("\n", $remoteXml);
-//		$remoteXmlArray = explode("\n", $remoteXml);
-//		for ($i=0; $i<count($localXmlArray); $i++) {
-//			$localXmlArray[$i] = trim(htmlentities($localXmlArray[$i]));
-//		}
-//		for ($i=0; $i<count($remoteXmlArray); $i++) {
-//			$remoteXmlArray[$i] = trim(htmlentities($remoteXmlArray[$i]));
-//		}
-//		print_r($localXmlArray);
-//		print_r($remoteXmlArray);			
-		if (!$remoteXml) {
-			$result = -1;
-			echo "Connection failed.</td><td><img src ='../img/trafficlights/stop.bmp'></td></tr>";
-		}
-		elseif (!$localXml) {
-			$result = 0;
-		}
-		else {
-			
-			if ($localXml == $remoteXml) {
-				$result = 1;
-				echo "WMS is stable.</td><td><img src ='../img/trafficlights/go.bmp'></td></tr>";
-			}
-			else {
-				$result = 0;
-			}
-		}
-		if ($result == 0) {
-			$mywms = new wms();
-			$result = $mywms->createObjFromXML($myURL);
-			
-			if ($result == true) {
-				$mywms->updateObjInDB($wmsId);
-				echo "Updating WMS " . $wmsId . "...</td><td><img src ='../img/trafficlights/wait.bmp'></td></tr>";
-			}
-			else {
-				$result = -1;
-				echo "Invalid getCapabilities request.</td><td><img src ='../img/trafficlights/stop.bmp'></td></tr>";
-			}    
-		}
-	}
-}
-echo "</table>";
-echo "<br>Monitoring Cycle completed.";
-?>
-</body>
-</html>
\ No newline at end of file



More information about the Mapbender_commits mailing list