Return to bug47767.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: bug #47767 (include_once does not resolve windows symlinks or junctions) 3: --CREDITS-- 4: Venkat Raman Don 5: --SKIPIF-- 6: <?php 7: if(substr(PHP_OS, 0, 3) != 'WIN' ) { 8: die('skip windows only test'); 9: } 10: if(PHP_WINDOWS_VERSION_MAJOR < 6) { 11: die('skip windows version 6.0+ only test'); 12: } 13: 14: $ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); 15: if (strpos($ret, 'privilege')) { 16: die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); 17: } 18: ?> 19: --FILE-- 20: <?php 21: echo "Testing include_once using file symbolic link\n"; 22: $filename = __DIR__ . '\\a.php'; 23: $content = '<?php echo "I am included\n" ?>'; 24: file_put_contents($filename, $content); 25: $softlinkname = __DIR__ . '\\a_slink.php'; 26: symlink($filename, $softlinkname); 27: include_once("$filename"); 28: include_once("$softlinkname"); 29: include_once("$softlinkname"); 30: 31: echo "Testing include_once using directory symbolic link\n"; 32: $softdirlinkname = __DIR__ . "\\a_dir"; 33: symlink(__DIR__, $softdirlinkname); 34: include_once("$softdirlinkname" . '\\a.php'); 35: 36: echo "Testing include_once using junction points\n"; 37: $junctionname = __DIR__ . '\\a_jdir'; 38: exec("mklink /J $junctionname " . __DIR__); 39: include_once("$junctionname" . '\\a.php'); 40: 41: unlink($filename); 42: unlink($softlinkname); 43: rmdir($softdirlinkname); 44: rmdir($junctionname); 45: ?> 46: --EXPECT-- 47: Testing include_once using file symbolic link 48: I am included 49: Testing include_once using directory symbolic link 50: Testing include_once using junction points