Welcome Guest, Not a member yet? Register   Sign In
Tracking long running php scripts externally
#2

[eluser]PhilTem[/eluser]
I think I've done something similar just recently when I was setting up my server to use the GitHub POST-commit hook and do a dirty deployment of my page. The first two lines of my deployment script are the following

Code:
// This will continue script execution even if the page was closed in the browser
//  or the request ended on a different way
ignore_user_abort(TRUE);

// Important to set the time limit otherwise you won't be able to deploy huge
//  commits/pushes since the script will just timeout
set_time_limit(30);

Actually it's more than two lines but there are just two lines really doing something. I think in your case you might wanna check out the PHP docu on ignore_user_abort since this should basically - at least I hope so - solve your problem: Scripts won't stop executing once the URL was called and the browser window closed while loading.
Combined with some AJAX this could work to have a link change from something like "start" to "running..."


Messages In This Thread
Tracking long running php scripts externally - by El Forum - 11-24-2012, 02:28 PM
Tracking long running php scripts externally - by El Forum - 11-24-2012, 03:18 PM
Tracking long running php scripts externally - by El Forum - 11-26-2012, 10:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB