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 = __DIR__; 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()); 40 41echo "Done"; 42ob_end_flush(); 43?> 44--CLEAN-- 45$initdir = __DIR__; 46$sessions = ($initdir."/sessions"); 47chdir($initdir); 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 24 55string(0) "" 56 57Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line 26 58 59Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line 26 60bool(false) 61string(0) "" 62 63Warning: session_destroy(): Trying to destroy uninitialized session in %s on line 28 64bool(false) 65string(0) "" 66Done 67