Created
October 12, 2011 19:25
-
-
Save mjuhl/1282248 to your computer and use it in GitHub Desktop.
Long running script that doesn't care if the user presses stop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Ignore user aborts and allow the script | |
// to run forever | |
ignore_user_abort(true); | |
ob_start();// if notifying the user | |
set_time_limit(0); | |
// let the user know that they can press stop or navigate away without | |
// interrupting | |
ob_flush(); | |
flush(); | |
// do stuff that takes a long time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment