note 69957 added to function.set-time-limit

From: Date: Wed, 27 Sep 2006 21:03:37 +0000
Subject: note 69957 added to function.set-time-limit
Groups: php.notes 
Request: Send a blank email to php-notes+get-117753@lists.php.net to get a copy of this message
After the error Fatal error: Maximum execution time of [...] seconds exceeded [...] has appeared, shut-down functions are still called (afterwards). So, by using register_shutdown_function, you can save data in a session and offer the user a link to start the script again. Then the script can go on with the Session-data. Example: if you are analyzing a text-file, you can save your analyzed data in a session together with the position of the filepointer (ftell) and start from that possition the next time the user runs the script (fseek). To determine whether the script was finished or aborted, you simply set a bool false at the beginning and true at the end, and in the shutdown-function you check if it's still false. ---- Server IP: 66.163.161.117 Probable Submitter: 84.169.73.179 ---- Manual Page -- http://www.php.net/manual/en/function.set-time-limit.php Edit -- https://master.php.net/note/edit/69957 Del: integrated -- https://master.php.net/note/delete/69957/integrated Del: useless -- https://master.php.net/note/delete/69957/useless Del: bad code -- https://master.php.net/note/delete/69957/bad+code Del: spam -- https://master.php.net/note/delete/69957/spam Del: non-english -- https://master.php.net/note/delete/69957/non-english Del: in docs -- https://master.php.net/note/delete/69957/in+docs Del: other reasons-- https://master.php.net/note/delete/69957 Reject -- https://master.php.net/note/reject/69957 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117753) next »