In the last example the call to ignore_user_abort() is used incorrectly. The manual clearly states that is the first parameter is not given, only the value is returned!
Specify a boolean value like this,
ignore_user_abort(TRUE);
![]() |
|
||||||||||
|
ignore_user_abort(PHP 3 >= 3.0.7, PHP 4, PHP 5) ignore_user_abort -- Set whether a client disconnect should abort script executionDescriptionint ignore_user_abort ( [bool setting] )This function sets whether a client disconnect should cause a script to be aborted. It will return the previous setting and can be called without an argument to not change the current setting and only return the current setting. See the Connection Handling section in the Features chapter for a complete description of connection handling in PHP. See also connection_aborted(), and connection_status(). ignore_user_abort
adrian
26-Apr-2007 03:37
In the last example the call to ignore_user_abort() is used incorrectly. The manual clearly states that is the first parameter is not given, only the value is returned!
spiritual-coder at spiritual-coder dot com
13-Jul-2006 09:45
If you want to simulate a crontask you must call this script once and it will keep running forever (during server uptime) in the background while "doing something" every specified seconds (= $interval):
15-Dec-2005 12:44
"It will return the previous setting" -- not quite. It returns an int, not a bool (as per the syntax description)
Rustam
26-Jun-2005 04:57
I wrote a simple function that can "spawn" another thread within the webserver by making async http request. The page that is being spawned can call ignore_user_abort() and do whatever it wants in the background...
qartis at qartis dot com
06-Sep-2004 04:22
Note that the function name and description seem to be contradictory:
plamen at pulsator dot com
29-Mar-2001 09:21
The script should output something to the browser in order to abort. If there is no output the script keeps on running.
|