1--TEST--
2Test session_save_path() function : variation
3--SKIPIF--
4<?php include('skipif.inc');?>
5--INI--
6open_basedir=.
7session.save_handler=files
8session.save_path=
9session.name=PHPSESSID
10--FILE--
11<?php
12
13ob_start();
14
15/*
16 * Prototype : string session_save_path([string $path])
17 * Description : Get and/or set the current session save path
18 * Source code : ext/session/session.c
19 */
20
21echo "*** Testing session_save_path() : variation ***\n";
22$initdir = getcwd();
23$sessions = ($initdir."/sessions");
24
25chdir($initdir);
26
27// Delete the existing directory
28if (file_exists($sessions) === TRUE) {
29	@rmdir($sessions);
30}
31
32var_dump(mkdir($sessions));
33var_dump(chdir($sessions));
34ini_set("session.save_path", $initdir);
35var_dump(session_save_path());
36var_dump(session_start());
37var_dump(session_save_path());
38var_dump(session_destroy());
39var_dump(session_save_path());
40var_dump(rmdir($sessions));
41
42echo "Done";
43ob_end_flush();
44?>
45--CLEAN--
46$initdir = getcwd();
47$sessions = ($initdir."/sessions");
48var_dump(rmdir($sessions));
49--EXPECTF--
50*** Testing session_save_path() : variation ***
51bool(true)
52bool(true)
53
54Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
55string(0) ""
56
57Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
58
59Fatal error: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d
60
61