<?php #vim:ft=php
$dbname = tempnam(dirname(__FILE__), "phpsql");
function cleanup() {
+ $retry = 10;
+
if (is_resource($GLOBALS['db'])) {
@sqlite_close($GLOBALS['db']);
- usleep(500000);
}
- unlink($GLOBALS['dbname']);
+ do {
+ usleep(500000);
+ if (@unlink($GLOBALS['dbname']))
+ break;
+ } while (file_exists($GLOBALS['dbname']) && --$retry);
}
register_shutdown_function("cleanup");
$db = sqlite_open($dbname);
--TEST--
sqlite-oo: call method with $this
--FILE--
-<?php
+<?php
include "blankdb_oo.inc";
$db->query("CREATE TABLE strings(key VARCHAR(10), var VARCHAR(10))");
{
unset($this->db);
}
-
+
function __destruct()
{
echo "DESTRUCTED\n";
}
$obj = new sqlite_help($db);
-echo $obj->get_single('foo')."\n";;
+echo $obj->get_single('foo')."\n";
$obj->free();
unset($obj);
--EXPECT--
bar
===DONE===
-DESTRUCTED
\ No newline at end of file
+DESTRUCTED