Configuring project specfic setting

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
waxtonmax
Forum Newbie
Posts: 7
Joined: Thu Jun 12, 2008 7:25 pm
Contact:

Configuring project specfic setting

Post by waxtonmax »

Hi All,

I need one urgent help.

i am using PHP 5. Currently i am having DataBaseConfig object (an object that contain data base config like username , password , schema and etc..) . At present i am creating a new object and storing in the session for every user who successfully logging IN.

But the point here is , this database config is common to all the user, so my question is, instead of creating new object and storing in user session every time, IS THERE IS ANY WAY THAT, THIS CONFIG OBJECT CAN BE STORED GLOBALLY BUT SPECIFIC TO MY NAME SPACE ?

NOTE : BUT I ALSO HEARD THAT , IT IS NOT ADVISABLE TO GLOBAL VARIABLES....

PLEASE KINDLY HELP IN THIS PROBLEM

Thanks in advance

Regards
S Anand
waxtonmax
Forum Newbie
Posts: 7
Joined: Thu Jun 12, 2008 7:25 pm
Contact:

Re: Configuring project specfic setting

Post by waxtonmax »

i got many reply from other forum that, In PHP we cannot maintain singleton object as java can hold a object for entire application. But there are ways to maintain object specific to session.
Post Reply