[fusion-commits] r1898 - trunk/layers/MapServer/php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Sep 17 13:36:20 EDT 2009


Author: madair
Date: 2009-09-17 13:36:19 -0400 (Thu, 17 Sep 2009)
New Revision: 1898

Modified:
   trunk/layers/MapServer/php/Query.php
Log:
closes #246:  add check for version number and set query template accordingly

Modified: trunk/layers/MapServer/php/Query.php
===================================================================
--- trunk/layers/MapServer/php/Query.php	2009-09-17 12:21:09 UTC (rev 1897)
+++ trunk/layers/MapServer/php/Query.php	2009-09-17 17:36:19 UTC (rev 1898)
@@ -68,6 +68,19 @@
     $oMap = ms_newMapObj($_SESSION['maps'][$mapName]);
 }
 
+//extension of query template changed as of v5.2.2
+$msVersion = ms_GetVersion();
+//MapServer version 5.0.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
+$versArray = explode(" ",$msVersion);
+$versNumber = $versArray[2];
+$versParts = explode(".", $versNumber);
+$queryTemplate = "query.qry";
+//convert to an integer value to make the comparison easier
+$versValue = $versParts[0]*100 + $versParts[1]*10 + $versParts[2];
+if ($versValue >= 522) {
+  $queryTemplate = "query.qy";
+}
+
 /* add the spatial filter if provided.  It is expected to come as a
    WKT string, so we need to convert it to a shape */
 if ($spatialFilter !== false ) {



More information about the fusion-commits mailing list