note 109694 added to function.register-shutdown-function
| From: | Kokuswolf | Date: | Fri, 10 Aug 2012 13:40:20 +0000 |
| Subject: | note 109694 added to function.register-shutdown-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189982@lists.php.net to get a copy of this message | ||
In addition to what alexyam explained here is an another way:
If you call this at the beginning...
<?php
register_shutdown_function(function(){
fastcgi_finish_request();
});
?>
... you will be able to use shutdown_functions in a normal way (with exit) since
register_shutdown_functions put these callbacks on a stack. So this first one forces php-fpm to stop
the response output, but the script stay alive:
<?php
register_shutdown_function(function(){
fastcgi_finish_request();
});
register_shutdown_function(function(){
sleep(10);
echo "You can't see this and you don't have to wait for this";
});
?>
----
Server IP: 87.106.1.137
Probable Submitter: 217.91.162.102
----
Manual Page -- http://www.php.net/manual/en/function.register-shutdown-function.php
Edit -- https://master.php.net/note/edit/109694
Del: integrated -- https://master.php.net/note/delete/109694/integrated
Del: useless -- https://master.php.net/note/delete/109694/useless
Del: bad code -- https://master.php.net/note/delete/109694/bad+code
Del: spam -- https://master.php.net/note/delete/109694/spam
Del: non-english -- https://master.php.net/note/delete/109694/non-english
Del: in docs -- https://master.php.net/note/delete/109694/in+docs
Del: other reasons-- https://master.php.net/note/delete/109694
Reject -- https://master.php.net/note/reject/109694
Search -- https://master.php.net/manage/user-notes.php