Hi all,
I'd like to write a PHP daemon that listens for a specific port and, when requested by another PHP script, achieve some time consuming tasks.
For example, on my web site (books selling), someone can give an email address and receive my entire list of books as an attachment. Actually, the user has to wait for the message being formated then sent to the MTA before the result page is displayed.
So what I want is that the user request my books list, the script send all necessary information to the daemon which will send the message "in background".
I went through articles/support forum/and so on and yes, I know that PHP is out of purpose for such a thing but I still want/need it for some reasons (portability, possibility of using phpmailer classes instead of writing my own mime email system, ...)
What I need is someone who points me in some directions for :
1) a mechanism to launch the daemon without any accessible command line/cron, ...
2) a mechanism for the daemon to be able to fork itself like in C. The daemon should continue to answer requests while still sending a message.
This shoud be an interesting challenge ;-)
Regards,
Fabrice.