File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / session / tests / session_save_path_variation4.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 4 months 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, v5_3_10, HEAD
php

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

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