Page 1 of 1

Singleton solutions

Posted: Tue May 12, 2009 2:57 am
by nadavgg
Hi,
I have a php file being called from many server, in this file I would like to load a configuration file, I would like to load the file once for all php request, how can I do it?
Basically I would like to load the configuration file once and save its content in some kind of cache, then each PHP request will use this cache and save the resources in reading this configuration file over and over again.

Many thanks.

Re: Singleton solutions

Posted: Tue May 12, 2009 4:12 am
by Christopher
With PHP you usually load the configuration every request. Do you have a real performance problem?

Re: Singleton solutions

Posted: Tue May 12, 2009 6:04 am
by nadavgg
I expect to have a performance issue, is there a way to load the file into memory then read the params from there each call to the PHP?