Page 1 of 1

Configuring project specfic setting

Posted: Thu Aug 21, 2008 11:56 am
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

Re: Configuring project specfic setting

Posted: Thu Jul 16, 2009 12:55 pm
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.