I have a daemon (written in C, but I assume it does not really matter) which outputs messages with printf, and can get input and do stuff with this input (again, not really important what, but he sends those messages to a different machine to be saved there in the DB).
My question, how can I make this daemon to be a stream in PHP, so I can hook the input/output of, for example, file_put_contents to this stream.