'; ?>
Processing WMS (ID = " . $wmsId . ") "; // 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: " . $wms_title . " "; // 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. | ![]() | ";
}
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 "Get Capabilities Link![]() | ";
}
elseif (!$localXml) {
$result = 0;
}
else {
if ($localXml == $remoteXml) {
$result = 1;
echo "WMS is stable.![]() | ";
}
else {
$result = 0;
}
}
if ($result == 0) {
$mywms = new wms();
$result = $mywms->createObjFromXML($myURL);
if ($result == true) {
$mywms->updateObjInDB($wmsId);
echo "Updating WMS " . $wmsId . "...![]() | ";
}
else {
$result = -1;
echo "Invalid getCapabilities request.![]() | ";
}
}
}
}
echo "