PHP 7.2.0 Release Candidate 2 Released

Voting

Please answer this simple SPAM challenge: eight plus zero?
(Example: nine)

The Note You're Voting On

a1n2ton at gmail dot com
7 years ago
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();
?>

<< Back to user notes page

To Top