Ok so forgive me if this is a repeat of another question, but after searching I have not found a clear answer. What I basically want to do is have my php web application fire off some event (like an emailer or report generator) that may take a few minutes to complete and immediately return control to the page. I come from a .NET world where this can easily be accomplished with a thread.
So here's the workflow:
- User clicks 'generate Report' button
- ajax call made to '../blah/generate-report' and returns immediately
- process is started and runs until completion while the user can then go about his business
- User can return to report page and see progress: "Report 50% complete"
What's the best way to accomplish this? Brief answers are fine. I don't want code written for me, just some guidance. I looked at shell_exec but I'm not sure exactly if that is the best way or if it is, how to use it to process functions within a web app. (I'm using the Yii framework if that makes any difference). Thanks.
-Jason