Singleton solutions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nadavgg
Forum Newbie
Posts: 2
Joined: Tue May 12, 2009 2:53 am

Singleton solutions

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Singleton solutions

Post by Christopher »

With PHP you usually load the configuration every request. Do you have a real performance problem?
(#10850)
nadavgg
Forum Newbie
Posts: 2
Joined: Tue May 12, 2009 2:53 am

Re: Singleton solutions

Post 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?
Post Reply