<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2491" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi Aileen</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>a configuration file is a simple text file containing the
variable assignation, like this:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>CARTOCLIENT_BASE_URL = "<A
href="http://your/path/to/cartoweb/htdocs/">http://your/path/to/cartoweb/htdocs/</A>"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>SHAPEPATH = "/bla/bla/bla/bla"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>DB_USER = xxxx<BR>DB_PASSWD =
yyyy<BR>DB_HOST = localhost<BR>DB_PORT =
1234<BR>DB_NAME = test<BR></FONT></DIV>
<DIV><FONT size=2>then just point on this file when launching the setup
script:</FONT></DIV>
<DIV><FONT size=2>cw3setup.php --install --config-from-file
/some/path/to/the/config/file/config_file</FONT></DIV>
<DIV><FONT size=2>the setup script will look for all files whose extension is
.ini.in and replace the variable accordingly to what you seted in the
configuration file.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Regards,</FONT></DIV>
<DIV><FONT size=2>Oliver</DIV></FONT>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV><FONT face=Arial size=2>hi oliver.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm sorry but i'm failrly new to
this.</FONT></DIV>
<DIV><FONT face=Arial size=2>How do you set a configuration file containing
the variable replacement values?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I would appreciate any help.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Aileen</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT size=2></FONT><BR></DIV>
<DIV><FONT size=2>Hi Aileen,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>by 'passing a variable from php to a map file' you mean
writing some parameters to the mapfile before usage (like database
connetions parameters) or modifying the mapfile object on the fly to
imediat usage?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>To write parameters you can use the install script
function, change your mapfile extension to .map.in and add the
variables replacement tags @YOUR_VARIABLE@ where they are needed. After that
set a configuration file containing the variable replacement values. Then
you just need to do a cw3setup.php --install --config-from-file
path_to_and_name_of_the_config_file</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If you need to modify the mapfile object on the fly, you
can have a look at the plugin Outline, in ServerOutline.php </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>$msMapObj = $this->serverContext->getMapObj(); this
will get you the map object</FONT></DIV>
<DIV><FONT size=2>then its just a question of using phpmapscript functions
and properties: <A
href="http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/referencemanual-all-pages">http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/referencemanual-all-pages</A></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>there are some exemple of usage in ServerOutline.php to
access, create, modify and remove elements (layers, style, class,
... )</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT size=2></FONT><BR></DIV>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We are having trouble passing a variable from
php to a map file.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>How do you declare this in php?</FONT></DIV>
<DIV><FONT face=Arial size=2>How do you catch this in the map
file?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We want to pass the "source_id" &
"target_id" to the mapfile?</FONT></DIV>
<DIV><FONT face=Arial size=2>we are still on the R&D stage and we are
trying to customize the demoPlugin but with our data?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any help will be much
appreciated.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Aileen</FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing
list<BR>Cartoweb-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/cartoweb-users<BR></BLOCKQUOTE>
<P>
<HR>
<P></P>No virus found in this incoming message.<BR>Checked by AVG Free
Edition.<BR>Version: 7.1.392 / Virus Database: 268.5.6/337 - Release Date:
5/11/2006<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>