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 12--FILE-- 13<?php 14 15ob_start(); 16/* 17 * Prototype : string session_save_path([string $path]) 18 * Description : Get and/or set the current session save path 19 * Source code : ext/session/session.c 20 */ 21 22echo "*** Testing session_save_path() : variation ***\n"; 23$directory = dirname(__FILE__); 24$sessions = ($directory."/sessions"); 25 26chdir($directory); 27ini_set('open_basedir', '.'); 28// Delete the existing directory 29if (file_exists($sessions) === TRUE) { 30 @rmdir($sessions); 31} 32 33var_dump(mkdir($sessions)); 34var_dump(chdir($sessions)); 35ini_set("session.save_path", $directory); 36var_dump(session_save_path()); 37var_dump(rmdir($sessions)); 38 39echo "Done"; 40ob_end_flush(); 41?> 42--CLEAN-- 43$directory = dirname(__FILE__); 44$sessions = ($directory."/sessions"); 45var_dump(rmdir($sessions)); 46--EXPECTF-- 47*** Testing session_save_path() : variation *** 48bool(true) 49bool(true) 50 51Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d 52string(0) "" 53bool(true) 54Done 55