/hphp/test/zend/bad/ext/standard/tests/file/windows_links/bug48746_2.php
PHP | 28 lines | 27 code | 1 blank | 0 comment | 0 complexity | 5b32fa8120faa0533b9042221f0aa486 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- include_once __DIR__ . '/common.inc';
- $mountvol = get_mountvol();
- $old_dir = __DIR__;
- $dirname = __DIR__ . "\\mnt\\test\\directory";
- exec("mkdir " . $dirname, $output, $ret_val);
- chdir(__DIR__ . "\\mnt\\test");
- $drive = substr(__DIR__, 0, 2);
- $pathwithoutdrive = substr(__DIR__, 2);
- $ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
- exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
- $fullpath = "mounted_volume" . $pathwithoutdrive;
- exec("mklink /j mklink_junction directory", $output, $ret_val);
- file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
- file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
- print_r(scandir("mklink_junction"));
- print_r(scandir("$fullpath\\mnt\\test\\directory"));
- print_r(scandir("$fullpath\\mnt\\test\\mklink_junction"));
- unlink("$fullpath\\mnt\\test\\directory\\b.php");
- unlink("mklink_junction\\a.php");
- chdir($old_dir);
- rmdir(__DIR__ . "\\mnt\\test\\directory");
- rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
- rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
- rmdir(__DIR__ . "\\mnt\\test");
- rmdir(__DIR__ . "\\mnt");
- ?>