persistent PEAR object
| From: | yavo | Date: | Mon, 21 May 2001 12:29:08 +0000 |
| Subject: | persistent PEAR object | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-412@lists.php.net to get a copy of this message | ||
A common problem with web pages is that they do not preserve any data among
requests. I had the following idea last night. use a combination of
Cache/phpsessionid/Pear constructors destructors to preserve the state of
objects.
Here is how it would work.
*) when constructor is called it chechs it a combination of
phpseshid_objectname is found in the cache (you'll need some additional info
to generate the UID, or maybe save diffrent object types in diffrent cache
repositories) if found load it in the current object.
**) when destructor is called, save the object in the cache.
Benefits
reduse load on the database (if one)
object persistance, you don't have to save/load data beetwin requests (you
do but it's done internally)
easier to build distrubuted applications (if using a common repository for
multiple servers)
Comments ???
yavo