Devraj Mukherjee wrote:
The first part of the problem is that I need to be able to at all times maintain a readable set of objects in memory, I am planning to achieve that using session variables, but I hear that session variables can become very inefficient, how true is that?

Very true. In Java (with Tomcat for example) you have a real session scope and application scope where you can put objects and directly access them. These objects are hold in memory and they are REAL objects between the requests. In PHP it's different. If a HTTP request is finished then the session (with all data including objects) is serialized and stored on the harddisk (or database or whatever the session backend is). On the next HTTP request the session is loaded from harddisk and unserialized. So new objects are created and filled with data from the harddisk at every request.

It would be REALLY REALLY cool to have an application-server-like thingy in PHP. But as far as I know there is none. Correct me if I'm wrong.


The other issue is running a thread that enable in some time interval to write snapshots from the log files that are being generated. Is it possible to have part of the script alive in some sort of a thread even after the script is dead. For example with the use of the sesssion variable.

You can write a command line PHP script and run it as a separate daemon or call it from the crontab.

--
Bye, K <http://www.ailis.de/~k/> (FidoNet: 2:240/2188.18)
[A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
(Finger [EMAIL PROTECTED] to get public key)

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to