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