Using the PHP Function Ignore_User_Abort With RunCloud
If you're developing a website with RunCloud, you may want to enable some of the more advanced PHP functions that are disabled by default for security reasons. These features include php function ignore_user_abort, which sets whether a disconnect from the client should cause a script to terminate and register_shutdown_function(), which allows you to specify a clean up function that will be called when the script ends.
This article will cover the php function ignore_user_abort and show how it can be used to implement planning tasks and continuous process instances in PHP. It is important to note that this method of implementation is not without cost, however. It will be a little expensive to keep the PHP execution server continuously running as it will need to be restarted regularly.
php function ignore_user_abort
This boolean function sets whether a disconnect from the client should trigger the termination of a script. If set to False, it causes a script to stop running. If not set, it returns the previous setting.
Calling this function without any arguments will not change the current setting, and simply return the previous value as a boolean. You can also use register_shutdown_function() to pass in any functions you wish to be called when the script terminates. This is a very useful feature to have in your development environment to ensure all of the work you put into a script is not lost if your end-user closes their browser or clicks the stop button.