PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/file/windows_links/bug48746_2.php

http://github.com/facebook/hiphop-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
  1. <?php
  2. include_once __DIR__ . '/common.inc';
  3. $mountvol = get_mountvol();
  4. $old_dir = __DIR__;
  5. $dirname = __DIR__ . "\\mnt\\test\\directory";
  6. exec("mkdir " . $dirname, $output, $ret_val);
  7. chdir(__DIR__ . "\\mnt\\test");
  8. $drive = substr(__DIR__, 0, 2);
  9. $pathwithoutdrive = substr(__DIR__, 2);
  10. $ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
  11. exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
  12. $fullpath = "mounted_volume" . $pathwithoutdrive;
  13. exec("mklink /j mklink_junction directory", $output, $ret_val);
  14. file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
  15. file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
  16. print_r(scandir("mklink_junction"));
  17. print_r(scandir("$fullpath\\mnt\\test\\directory"));
  18. print_r(scandir("$fullpath\\mnt\\test\\mklink_junction"));
  19. unlink("$fullpath\\mnt\\test\\directory\\b.php");
  20. unlink("mklink_junction\\a.php");
  21. chdir($old_dir);
  22. rmdir(__DIR__ . "\\mnt\\test\\directory");
  23. rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
  24. rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
  25. rmdir(__DIR__ . "\\mnt\\test");
  26. rmdir(__DIR__ . "\\mnt");
  27. ?>