PHP <> J2ee
Posted on 2007-04-10
I am using JSP when developing web applications, and learning PHP.
In my j2ee based web applications, I have usually an "application configuration" ,
which is an xml file that defines some constants for my web applications.
I have then a start-on-load servlet, which is a thread that is running when the web application starts,
and is reading this xml file and put the constant in memory (static variables).
I wonder how we can do such things in PHP ... since I can't see anything about threads.
Another example would be a user making a request that takes a very long time for the application,
in JSP i would launch a new thread, so that user don't have to wait this long process,
but in PHP this isn't possible.
A last example :
I have a chat server and I want to display on my website the status of this chat server
(on / off / number of connected / etc.)
In JSP it is quite simple, I could launch a thread, which is querying every X seconds the chat server,
and change some constants in the web application. In my .jsp pages, for each user request (user thread) I just read the constants and display them.
How could I do such a thing in PHP ?
Thak u for any comment.