024-opcache-win32.phpt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. Phar: phar:// include with Opcache
  3. --EXTENSIONS--
  4. phar
  5. opcache
  6. --SKIPIF--
  7. <?php
  8. if (strpos(PHP_OS, 'WIN') === false) die("skip Extra warning on Windows.");
  9. $cache_dir = dirname(__FILE__) . "/024-file_cache";
  10. if (!is_dir($cache_dir) && !mkdir($cache_dir)) die("skip unable to create file_cache dir");
  11. ?>
  12. --INI--
  13. phar.require_hash=0
  14. opcache.enable=1
  15. opcache.enable_cli=1
  16. opcache.file_cache={PWD}/024-file_cache
  17. opcache.memory_consumption=64
  18. opcache.interned_strings_buffer=8
  19. opcache.max_accelerated_files=4000
  20. opcache.jit_buffer_size=6M
  21. opcache.revalidate_freq=60
  22. opcache.fast_shutdown=1
  23. --FILE--
  24. <?php
  25. $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
  26. $pname = 'phar://' . $fname;
  27. $file = "<?php __HALT_COMPILER(); ?>";
  28. $files = array();
  29. $files['a.php'] = '<?php echo "This is a\n"; ?>';
  30. $files['b.php'] = '<?php echo "This is b\n"; ?>';
  31. $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
  32. include 'files/phar_test.inc';
  33. include $pname . '/a.php';
  34. include $pname . '/b.php';
  35. include $pname . '/b/c.php';
  36. $cache_dir = ini_get("opcache.file_cache");
  37. if (is_dir($cache_dir)) {
  38. $it = new RecursiveIteratorIterator(
  39. new RecursiveDirectoryIterator($cache_dir, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST
  40. );
  41. foreach ($it as $fi) {
  42. $fn = ($fi->isDir() ? 'rmdir' : 'unlink');
  43. $fn($fi->getRealPath());
  44. }
  45. rmdir($cache_dir);
  46. }
  47. ?>
  48. --CLEAN--
  49. <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  50. --EXPECT--
  51. This is a
  52. This is b
  53. This is b/c