One way to simulate an application object is to use the php.ini
"auto_prepend_file" option. Set the file with your application variables to
be the file you want to prepend to every file in your application. Now, the
only part that you don't have is an easy way to add/update/delete these
variables. I suppose you could write a fairly simple class that allowed you
to manipulate the file line by line, which would essentially give you access
to all the variables for add/update/delete functionality.
I use "auto_prepend_file" quite a bit for my applications and it acts just
like an application object. I haven't found a time where I need/want to
manipulate the variables "on the fly" within code. Most of the variables
being set are simply configuration settings for the application, not
variables needing to change and be shared across the application.
Hope that helps some,
> > For those of you not familiar with ASP, the lowdown is this: The
> > application object acts like a global session. You assign it variables
> > and values like you would a session, but those variables are available
> > to all instances and sessions. It is for example very useful to track
> > different users at the same time, or to send messages from one session
> > to another, or the likes.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php