note 95087 added to features.connection-handling
| From: | a1n2ton at gmail dot com | Date: | Sat, 12 Dec 2009 21:09:44 +0000 |
| Subject: | note 95087 added to features.connection-handling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163894@lists.php.net to get a copy of this message | ||
PHP changes directory on connection abort so code like this will not do what you want:
<?php
function abort()
{
if(connection_aborted())
unlink('file.ini');
}
register_shutdown_function('abort');
?>
actually it will delete file in apaches's root dir so if you want to unlink file in your
script's dir on abort or write to it you have to store directory
<?php
function abort()
{
global $dsd;
if(connection_aborted())
unlink($dsd.'/file.ini');
}
register_shutdown_function('abort');
$dsd=getcwd();
?>
----
Server IP: 195.54.192.44
Probable Submitter: 91.79.21.219
----
Manual Page -- http://www.php.net/manual/en/features.connection-handling.php
Edit -- https://master.php.net/note/edit/95087
Del: integrated -- https://master.php.net/note/delete/95087/integrated
Del: useless -- https://master.php.net/note/delete/95087/useless
Del: bad code -- https://master.php.net/note/delete/95087/bad+code
Del: spam -- https://master.php.net/note/delete/95087/spam
Del: non-english -- https://master.php.net/note/delete/95087/non-english
Del: in docs -- https://master.php.net/note/delete/95087/in+docs
Del: other reasons-- https://master.php.net/note/delete/95087
Reject -- https://master.php.net/note/reject/95087
Search -- https://master.php.net/manage/user-notes.php