Patch 61746.patch.txt for *Directory/Filesystem functions Bug #61746
Patch version 2012-05-07 21:52 UTC
Return to Bug #61746 |
Download this patch
Patch Revisions:
Developer: mattficken@php.net
--- a/ext/standard/tests/file/windows_links/common.inc Mon Jan 19 14:26:36 1970
+++ b/ext/standard/tests/file/windows_links/common.inc Mon Jan 19 14:26:36 1970
+<?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";
+}
+
+?>
--- a/ext/standard/tests/file/windows_links/bug48746.phpt Mon Jan 19 14:26:36 1970
+++ b/ext/standard/tests/file/windows_links/bug48746.phpt Mon Jan 19 14:26:36 1970
@@ -11,3 +11,4 @@
}
-$cmd = "mklink.exe /?";
+include_once __DIR__ . '/common.inc';
+$cmd = "mklink /?";
$ret = @exec($cmd, $output, $return_val);
@@ -19,3 +20,4 @@
<?php
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
$old_dir = __DIR__;
--- a/ext/standard/tests/file/windows_links/bug48746_1.phpt Mon Jan 19 14:26:36 1970
+++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt Mon Jan 19 14:26:36 1970
@@ -11,3 +11,4 @@
}
-$cmd = "mklink.exe /?";
+include_once __DIR__ . '/common.inc';
+$cmd = "mklink /?";
$ret = @exec($cmd, $output, $return_val);
@@ -19,3 +20,4 @@
<?php
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
$old_dir = __DIR__;
--- a/ext/standard/tests/file/windows_links/bug48746_2.phpt Mon Jan 19 14:26:36 1970
+++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt Mon Jan 19 14:26:36 1970
@@ -11,2 +11,3 @@
}
+include_once __DIR__ . '/common.inc';
$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
@@ -15,3 +16,3 @@
}
-unlink('mklink bug48746_tmp.lnk');
+unlink('bug48746_tmp.lnk');
?>
@@ -19,3 +20,4 @@
<?php
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
$old_dir = __DIR__;
--- a/ext/standard/tests/file/windows_links/bug48746_3.phpt Mon Jan 19 14:26:36 1970
+++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt Mon Jan 19 14:26:36 1970
@@ -11,3 +11,4 @@
}
-$ret = exec('junction /? 2>&1', $out);
+include_once __DIR__ . '/common.inc';
+$ret = exec(get_junction().' /? 2>&1', $out);
if (strpos($out[0], 'recognized')) {
@@ -19,2 +20,3 @@
<?php
+include_once __DIR__ . '/common.inc';
$old_dir = __DIR__;
@@ -23,3 +25,3 @@
chdir(__DIR__ . "\\mnt\\test");
-exec("junction junction directory", $output, $ret_val);
+exec(get_junction()." junction directory", $output, $ret_val);
file_put_contents("junction\\a.php", "<?php echo \"I am included.\n\" ?>");
|