2003-04-18 19:22:49 +00:00
|
|
|
<?php #vim:ft=php
|
2003-04-18 20:53:18 +00:00
|
|
|
$dbname = tempnam(dirname(__FILE__), "phpsql");
|
2003-04-18 19:22:49 +00:00
|
|
|
function cleanup() {
|
2004-01-08 16:55:37 +00:00
|
|
|
$retry = 10;
|
|
|
|
|
2003-12-05 13:42:04 +00:00
|
|
|
if (is_resource($GLOBALS['db'])) {
|
|
|
|
@sqlite_close($GLOBALS['db']);
|
2003-04-18 20:53:18 +00:00
|
|
|
}
|
2004-01-08 16:55:37 +00:00
|
|
|
do {
|
|
|
|
usleep(500000);
|
|
|
|
if (@unlink($GLOBALS['dbname']))
|
|
|
|
break;
|
|
|
|
} while (file_exists($GLOBALS['dbname']) && --$retry);
|
2003-04-18 19:22:49 +00:00
|
|
|
}
|
|
|
|
register_shutdown_function("cleanup");
|
|
|
|
$db = sqlite_open($dbname);
|
|
|
|
?>
|