I’m wondering if there are any completely event-drive frameworks out there for PHP which are based around dependency injection for decoupling. I know there are some frameworks that make use of these patterns – but in the end the entire life-cycle of the application is still pre-defined and linear in style.
For example, most frameworks are built to receive, process, and return results from HTTP requests. An event drive framework would have handlers for that, but also be able to be used for new purposes like background processing, command line interaction, or other non-standard use cases.
It sounds to me like the Photon framework fits closest to your description – the key point is that you can’t have event-driven code without php running in a daemon-like process. Your choice of webserver in fact dictates whether what you ask is possible or not – photon is dependent on mongrel2.