1--TEST--
2SQLite3 open_basedir checks
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--INI--
6open_basedir=.
7--FILE--
8<?php
9$directory = dirname(__FILE__) . '/';
10$file = uniqid() . '.db';
11
12echo "Within test directory\n";
13$db = new SQLite3($directory . $file);
14var_dump($db);
15var_dump($db->close());
16unlink($directory . $file);
17
18echo "Above test directory\n";
19try {
20	$db = new SQLite3('../bad' . $file);
21} catch (Exception $e) {
22	echo $e . "\n";
23}
24
25echo "Done\n";
26?>
27--EXPECTF--
28Within test directory
29object(SQLite3)#%d (0) {
30}
31bool(true)
32Above test directory
33
34Warning: SQLite3::__construct(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %ssqlite3_21_security.php on line %d
35exception 'Exception' with message 'open_basedir prohibits opening %s' in %ssqlite3_21_security.php:%d
36Stack trace:
37#0 %ssqlite3_21_security.php(%d): SQLite3->__construct('%s')
38#1 {main}
39Done
40