[MS4W-Users] Organizing and Using Global Connections in MAP Files

Andrew Tegenkamp ategenkamp at interactivegis.com
Fri Mar 4 15:15:39 UTC 2022


We have MS4W 4.0.5 and are using PostGIS that interacts with a PHP web 
application.

We're using standard Mapfiles and MapScript, and I have the 
"CONNECTIONTYPE postgis" and "CONNECTION "host=..." lines in a bunch of 
map files and am working to clean up and consolidate my code at the 
moment.

I'd like to find a way to make that a global variable so it's easier to 
update and change. For convenience I'd prefer to store some of the MAP 
files inside the web root but don't want to expose the database 
connection so I'm keeping it outside the web root for now.

My first thought was to set a .htaccess file to process .map files like 
.php and add my own PHP, but of course the mapfile location is a local 
file c:\ms4w\ so it does not process any PHP in a MAP file and tells me 
"First token must be MAP, this doesn't look like a mapfile" which makes 
sense.

Does anyone have a good strategy for organizing multiple Mapfiles and 
making a more global CONNECTION line that I'm missing?

None of this is a requirement and I can do global find and replace 
operations, but it seemed there may be a better way, so I wanted to 
reach out and see if anyone had a better way than I did!

Thanks,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20220304/a7d30de4/attachment.htm>


More information about the MS4W-Users mailing list