mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
18 lines
372 B
PHP
18 lines
372 B
PHP
<?php #vim:ft=php
|
|
$dbname = tempnam(dirname(__FILE__), "phpsql");
|
|
function cleanup() {
|
|
$retry = 10;
|
|
|
|
if (is_resource($GLOBALS['db'])) {
|
|
@sqlite_close($GLOBALS['db']);
|
|
}
|
|
do {
|
|
usleep(500000);
|
|
if (@unlink($GLOBALS['dbname']))
|
|
break;
|
|
} while (file_exists($GLOBALS['dbname']) && --$retry);
|
|
}
|
|
register_shutdown_function("cleanup");
|
|
$db = sqlite_open($dbname);
|
|
?>
|