Hi,
My script needs to load a config file with DB connection properties, etc. At the beginning of the session, the ini file is loaded and all values are stored in $_SESSION After the loading, a flag is also set in $_SESSION so that the ini loading is no more executed.
However, all ini properties are the same for all users, so I wonder if I could put them in a cross-session variable. I guess $_ENV or $_SERVER should be good.
So, the question could be :
If I put something in $_SERVER, will these values be available for ALL users?
Any idea?
I have to keep the ini file, and could not hard code those properties.
Vincent
There is no easy way to do this, no. $_ENV and $_SERVER are populated by PHP and changes won't be saved. If you need somehting like this, you may want to look into using serialize() on your structure and putting it in a file, then reading the file in your other pages. Of course, sessions already do this. Your filesystem should cache the file in memory for you, so it shouldn't be too much of a performance hit. If you're really worried about performance, you could make a RAM drive that the file could sit in.
-- paperCrane <Justin Patrin>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php