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();
?>