File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 11<?php #vim:ft=php
22$ dbname = tempnam (dirname (__FILE__ ), "phpsql " );
33function cleanup () {
4+ $ retry = 10 ;
5+
46 if (is_resource ($ GLOBALS ['db ' ])) {
57 @sqlite_close ($ GLOBALS ['db ' ]);
6- usleep (500000 );
78 }
8- unlink ($ GLOBALS ['dbname ' ]);
9+ do {
10+ usleep (500000 );
11+ if (@unlink ($ GLOBALS ['dbname ' ]))
12+ break ;
13+ } while (file_exists ($ GLOBALS ['dbname ' ]) && --$ retry );
914}
1015register_shutdown_function ("cleanup " );
1116$ db = sqlite_open ($ dbname );
Original file line number Diff line number Diff line change 11--TEST--
22sqlite-oo: call method with $this
33--FILE--
4- <?php
4+ <?php
55include "blankdb_oo.inc " ;
66
77$ db ->query ("CREATE TABLE strings(key VARCHAR(10), var VARCHAR(10)) " );
@@ -29,15 +29,15 @@ class sqlite_help
2929 {
3030 unset($ this ->db );
3131 }
32-
32+
3333 function __destruct ()
3434 {
3535 echo "DESTRUCTED \n" ;
3636 }
3737}
3838
3939$ obj = new sqlite_help ($ db );
40- echo $ obj ->get_single ('foo ' )."\n" ;;
40+ echo $ obj ->get_single ('foo ' )."\n" ;
4141$ obj ->free ();
4242unset($ obj );
4343
@@ -46,4 +46,4 @@ unset($obj);
4646--EXPECT--
4747bar
4848===DONE===
49- DESTRUCTED
49+ DESTRUCTED
You can’t perform that action at this time.
0 commit comments