if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
die('skip windows only test');\r
}\r
-$cmd = "mklink.exe /?";\r
+include_once __DIR__ . '/common.inc';\r
+$cmd = "mklink /?";\r
$ret = @exec($cmd, $output, $return_val);\r
if (count($output) == 0) {\r
die("mklink.exe not found in PATH");\r
?>\r
--FILE--\r
<?php\r
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";\r
+include_once __DIR__ . '/common.inc';\r
+$mountvol = get_mountvol();\r
$old_dir = __DIR__;\r
$dirname = __DIR__ . "\\mnt\\test\\directory";\r
mkdir($dirname, 0700, true);\r
if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
die('skip windows only test');\r
}\r
-$cmd = "mklink.exe /?";\r
+include_once __DIR__ . '/common.inc';\r
+$cmd = "mklink /?";\r
$ret = @exec($cmd, $output, $return_val);\r
if (count($output) == 0) {\r
die("mklink.exe not found in PATH");\r
?>\r
--FILE--\r
<?php\r
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';\r
+$mountvol = get_mountvol();\r
$old_dir = __DIR__;\r
$dirname = __DIR__ . "\\mnt\\test\\directory";\r
exec("mkdir " . $dirname, $output, $ret_val);\r
I am included.\r
bool(true)\r
bool(true)\r
-bool(true)
+bool(true)\r
if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
die('skip windows only test');\r
}\r
+include_once __DIR__ . '/common.inc';\r
$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);\r
if (strpos($ret, 'privilege')) {\r
die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');\r
}\r
-unlink('mklink bug48746_tmp.lnk');\r
+unlink('bug48746_tmp.lnk');\r
?>\r
--FILE--\r
<?php\r
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';\r
+$mountvol = get_mountvol();\r
$old_dir = __DIR__;\r
$dirname = __DIR__ . "\\mnt\\test\\directory";\r
exec("mkdir " . $dirname, $output, $ret_val);\r
[1] => ..\r
[2] => a.php\r
[3] => b.php\r
-)
+)\r
if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
die('skip windows only test');\r
}\r
-$ret = exec('junction /? 2>&1', $out);\r
+include_once __DIR__ . '/common.inc';\r
+$ret = exec(get_junction().' /? 2>&1', $out);\r
if (strpos($out[0], 'recognized')) {\r
die('skip. junction.exe not found in PATH.');\r
}\r
?>\r
--FILE--\r
<?php\r
+include_once __DIR__ . '/common.inc';\r
$old_dir = __DIR__;\r
$dirname = __DIR__ . "\\mnt\\test\\directory";\r
exec("mkdir " . $dirname, $output, $ret_val);\r
chdir(__DIR__ . "\\mnt\\test");\r
-exec("junction junction directory", $output, $ret_val);\r
+exec(get_junction()." junction directory", $output, $ret_val);\r
file_put_contents("junction\\a.php", "<?php echo \"I am included.\n\" ?>");\r
file_put_contents("junction\\b.php", "<?php echo \"I am included.\n\" ?>");\r
include "junction/a.php";\r
[1] => ..\r
[2] => a.php\r
[3] => b.php\r
-)
+)\r
--- /dev/null
+<?php
+
+function get_sysroot() {
+ // usually c:\\windows, but not always
+ return exec('echo %SYSTEMROOT%');
+}
+
+function get_junction(){
+ // junction.exe isn't included with Windows
+ // its a sysinternals tool for working with filesystem links
+ // see: http://technet.microsoft.com/en-us/sysinternals/bb896768
+
+ // install somewhere that is on %path% or added to %path%
+ return "junction.exe";
+}
+
+function get_mountvol() {
+ $sysroot = get_sysroot();
+
+ return "$sysroot\\System32\\mountvol.exe";
+}
+
+?>