Annotation of embedaddon/php/ext/session/tests/session_save_path_variation5.phpt, revision 1.1

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

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