File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / session / tests / session_save_path_variation5.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:42 2012 UTC (12 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>