I've created a PHP Daemon script to continually monitor a particular directory on the server's file system for new files, and then process and archive them.
Note: I'm using a php Daemon class provided at:
http://www.phpclasses.org/browse/file/8958.html
I've got the script running, but I need a way to interface with the daemon and issue commands. One really useful command, for instance, would be "STOP"! :) I currently have to kill the process manually.
I've done this before using control files (i.e., check the file for a new command, execute it if one exists, then clear the file). I've also used sockets, but this problem doesn't really call for any networking. Is there a better, more elegant or natural way to send command signals to the Daemon?
I did find this:
http://stackoverflow.com/questions/752214/php-daemon-worker-environment
But I'm afraid I don't fully grasp how to use the provided code.