bug47767.phpt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. bug #47767 (include_once does not resolve windows symlinks or junctions)
  3. --CREDITS--
  4. Venkat Raman Don
  5. --SKIPIF--
  6. <?php
  7. if(substr(PHP_OS, 0, 3) != 'WIN' ) {
  8. die('skip windows only test');
  9. }
  10. include_once __DIR__ . '/windows_links/common.inc';
  11. skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__);
  12. ?>
  13. --FILE--
  14. <?php
  15. echo "Testing include_once using file symbolic link\n";
  16. $filename = __DIR__ . '\\a.php';
  17. $content = '<?php echo "I am included\n" ?>';
  18. file_put_contents($filename, $content);
  19. $softlinkname = __DIR__ . '\\a_slink.php';
  20. symlink($filename, $softlinkname);
  21. include_once("$filename");
  22. include_once("$softlinkname");
  23. include_once("$softlinkname");
  24. echo "Testing include_once using directory symbolic link\n";
  25. $softdirlinkname = __DIR__ . "\\a_dir";
  26. symlink(__DIR__, $softdirlinkname);
  27. include_once("$softdirlinkname" . '\\a.php');
  28. echo "Testing include_once using junction points\n";
  29. $junctionname = __DIR__ . '\\a_jdir';
  30. exec("mklink /J $junctionname " . __DIR__);
  31. include_once("$junctionname" . '\\a.php');
  32. unlink($filename);
  33. unlink($softlinkname);
  34. rmdir($softdirlinkname);
  35. rmdir($junctionname);
  36. ?>
  37. --EXPECT--
  38. Testing include_once using file symbolic link
  39. I am included
  40. Testing include_once using directory symbolic link
  41. Testing include_once using junction points