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