1--TEST--
2Test open_basedir configuration
3--INI--
4open_basedir=.
5--FILE--
6<?php
7require_once "open_basedir.inc";
8$initdir = getcwd();
9test_open_basedir_before("error_log");
10
11define("DESTINATION_IS_FILE", 3);
12
13var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/bad/bad.txt"));
14var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/bad.txt"));
15var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/bad.txt"));
16var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/ok/ok.txt"));
17
18test_open_basedir_after("error_log");
19?>
20--CLEAN--
21<?php
22require_once "open_basedir.inc";
23delete_directories();
24?>
25--EXPECTF--
26*** Testing open_basedir configuration [error_log] ***
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31bool(true)
32
33Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
34
35Warning: error_log(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d
36bool(false)
37
38Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d
39
40Warning: error_log(%s/test/bad.txt): failed to open stream: %s in %s on line %d
41bool(false)
42
43Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d
44
45Warning: error_log(%s/bad.txt): failed to open stream: %s in %s on line %d
46bool(false)
47bool(true)
48*** Finished testing open_basedir configuration [error_log] ***
49
50