Skip to content

Instantly share code, notes, and snippets.

@mjuhl
Created October 12, 2011 19:25
Show Gist options
  • Save mjuhl/1282248 to your computer and use it in GitHub Desktop.
Save mjuhl/1282248 to your computer and use it in GitHub Desktop.
Long running script that doesn't care if the user presses stop
<?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