Re: [Package Proposal] PHP_Application_Vars
| From: | Matthias Nothhaft | Date: | Sat, 23 Aug 2003 21:31:23 +0000 |
| Subject: | Re: [Package Proposal] PHP_Application_Vars | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20446@lists.php.net to get a copy of this message | ||
Hi List,
well, I don't know exactly what you mean with 'Application_Vars',
but I think that it is an important issue to have a possibility
to clearly separate session vars of app_A from app_B
to avoid name conflicts in big/profi projects
for example if both wanna use a var '$step'.
But I think, this is a common php issue to provide separate
session namespaces...
I've worked on a solution to get this work,
and developed my own session management therefor...
Regards,
Matthias
Stefan Walk wrote:
I'm against using $_SESSION for this. It has some serious drawbacks, some of them already mentioned, others are: Only one script can use the same session at a time. If you use the same session throughout your application, that means you have only script running at a time - no concurrent requests anymore, which makes your application slow. Also, the syntactic sugar using $_SESSION is not really neccessary, because functions and class functions are also available everywhere. IMO, if Application vars are implemented, they should be accessed through (class) functions. You could have seperate classes for application variables using files, shared memory, databases, ... using the same API providing (at least) methods to get and set variables and beginning, commiting or reverting transactions.