Is there currently any system for application/server scope vars? In JSP (among other languages) I'm used to being able to define a variable and have it persist across requests. In a previous post this topic was covered but never resolved, as well I believe it was posted back at PHP3. To that end I'll trash the following ideas covered in it (among others π :
Session variables are all fine per client, but I need something that retains it state over the entire application.
I don't want a constant, variables are needed. Yes this opens the whole multithreaded environment, memmory locking bag of worms; which is hopefully dealt w/ in a nice function lib.
Opening a text file, or using a db will not work. Even if the overhead is low for text files, when you consider how much lower memmory access is (especially for larger data sets) it makes more sense in many cases. Also locking and unlocking them for write access makes it even slower.
The shm_() shared memory functions are *nix specific. While this is fine in most cases I really don't want to limit the platform unless absolutely necessary.
What I'm looking for is a set system for handling application/server wide variables w/ all the locking involved taken care of (read/exclusive). At this point in time I'm not overly concerned w/ security as most of the application will have dedicated servers. However, if there's already a system in place to deal w/ shared environments I won't complain π. I'm going to assume PHP4 has no such functioning as I can find no documentation of it. So what I guess I'm really asking is are there any multi-platform addons or libraries out there that support this?
If anyone can point me in the right direction I'd be appreciative; if you have code I'd be estatic π.
Thanks for your time.
(it's really really late here and I haven't had my caffine intake, so if anything is fuzzy and unclear... I'm blaming it on lack of coffee beans)