1--TEST-- 2Bug#48746 - Junction not working properly 3--CREDITS-- 4Venkat Raman Don (don.raman@microsoft.com) 5--SKIPIF-- 6<?php 7if(substr(PHP_OS, 0, 3) != 'WIN' ) { 8 die('skip windows only test'); 9} 10include_once __DIR__ . '/common.inc'; 11$cmd = "mklink /?"; 12$ret = @exec($cmd, $output, $return_val); 13if (count($output) == 0) { 14 die("skip mklink.exe not found in PATH"); 15} 16?> 17--FILE-- 18<?php 19include_once __DIR__ . '/common.inc'; 20$mountvol = get_mountvol(); 21$old_dir = __DIR__; 22$dirname = __DIR__ . "\\mnt\\test\\directory"; 23mkdir($dirname, 0700, true); 24chdir(__DIR__ . "\\mnt\\test"); 25$drive = substr(__DIR__, 0, 2); 26$pathwithoutdrive = substr(__DIR__, 2); 27$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val); 28exec("mklink /j mounted_volume " . $ret, $output, $ret_val); 29$fullpath = "mounted_volume" . $pathwithoutdrive; 30exec("mklink /j mklink_junction directory", $output, $ret_val); 31var_dump(file_exists("directory")); 32var_dump(file_exists("mklink_junction")); 33var_dump(file_exists("mounted_volume")); 34var_dump(file_exists("$fullpath")); 35var_dump(is_dir("mklink_junction")); 36var_dump(is_dir("$fullpath")); 37var_dump(is_readable("mklink_junction")); 38var_dump(is_writeable("$fullpath")); 39chdir($old_dir); 40 41rmdir(__DIR__ . "\\mnt\\test\\directory"); 42rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); 43rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); 44rmdir(__DIR__ . "\\mnt\\test"); 45rmdir(__DIR__ . "\\mnt"); 46 47?> 48--EXPECT-- 49bool(true) 50bool(true) 51bool(true) 52bool(true) 53bool(true) 54bool(true) 55bool(true) 56bool(true) 57