[mapserver-commits] r12897 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Wed Dec 14 04:10:32 EST 2011


Author: tbonfort
Date: 2011-12-14 01:10:32 -0800 (Wed, 14 Dec 2011)
New Revision: 12897

Modified:
   trunk/mapserver/mapcache/src/fastcgi_mapcache.c
Log:
add debug mode to cgi app for launching from command line


Modified: trunk/mapserver/mapcache/src/fastcgi_mapcache.c
===================================================================
--- trunk/mapserver/mapcache/src/fastcgi_mapcache.c	2011-12-14 08:16:23 UTC (rev 12896)
+++ trunk/mapserver/mapcache/src/fastcgi_mapcache.c	2011-12-14 09:10:32 UTC (rev 12897)
@@ -229,7 +229,24 @@
    ctx = (mapcache_context*)globalctx;
    
    conffile  = getenv("MAPCACHE_CONFIG_FILE");
+#ifdef DEBUG
    if(!conffile) {
+      int i;
+      for(i=1;i<argc;i++) {
+         if( strncmp(argv[i], "-c", 2) == 0 ) {
+            conffile = argv[i+1];
+            putenv( "REQUEST_METHOD=GET" );
+         }
+         else if( strncmp(argv[i], "QUERY_STRING=", 13) == 0 ) {
+            putenv( argv[i] );
+         }
+         else if( strncmp(argv[i], "PATH_INFO=", 10) == 0 ) {
+            putenv( argv[i] );
+         }
+      }
+   }
+#endif
+   if(!conffile) {
       ctx->log(ctx,MAPCACHE_ERROR,"no config file found in MAPCACHE_CONFIG_FILE envirronement");
       return 1;
    }



More information about the mapserver-commits mailing list