[Mapserver-users] Map files CGI - PHP MapScript

Vinko Vrsalovic vinko at cprsig.cl
Thu Dec 5 14:04:58 PST 2002


On Fri, Dec 06, 2002 at 06:24:20AM +1030, Benjamin Wragg wrote:
 
> I'm new to both PHP and MapServer so the following questions might be a
> little simple.
> 
> So from what you've said I can store the $map object in a session
> variable and not have to save it to a new mapfile.
 
Nope, when i said session variables or DB's i meant to save the values
(extents, symbols, colors, fonts, etc, etc.) to be set by PHP/Mapscript 
in the next run in a new mapObj. You can't save the mapObj in a PHP session 
variable because PHP needs to have the definition of the class to reconstruct it, 
and cannot see classes defined through extensions. 

The bottom line is that PHP can only store objects in a session variable 
if the class that define that object is written in PHP and available in 
the script that will have to deserialize the object.
 
This was discussed on the list a while ago, and I think I asked it :-).
And it was agreed that it would be nice to have a persistent mapObj,
but, as always, hands and brains with time to do it are needed.
 
> If I did save it to a new mapfile, on the next request my new mapfile
> would have to be parsed and the database connections restored. Is this
> correct?

Correct. Unless you leave the connections open and close them only upon
exiting the application. But the parsing (or construction through MapScript) 
of the mapfile needs to be done everytime.

-- 
Vinko Vrsalovic <el[|- at -|]vinko.cl>
http://www.cprsig.cl



More information about the MapServer-users mailing list