blacklist.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Blacklist (with glob, quote and comments)
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.blacklist_filename={PWD}/opcache-*.blacklist
  7. opcache.file_update_protection=0
  8. opcache.file_cache_only=0
  9. opcache.preload=
  10. --EXTENSIONS--
  11. opcache
  12. --SKIPIF--
  13. <?php
  14. if (substr(PHP_OS, 0, 3) == 'WIN') {
  15. die('skip not for Windows');
  16. }
  17. /* On macOS, `/tmp` is an alias to `/private/tmp` .
  18. * So, we should write `%S/tmp/path` as `/tmp/path`, except for Windows.
  19. */
  20. ?>
  21. --FILE--
  22. <?php
  23. $conf = opcache_get_configuration();
  24. $conf = $conf['blacklist'];
  25. $conf[3] = preg_replace("!^\\Q".__DIR__."\\E!", "__DIR__", $conf[3]);
  26. $conf[4] = preg_replace("!^\\Q".__DIR__."\\E!", "__DIR__", $conf[4]);
  27. print_r($conf);
  28. include("blacklist.inc");
  29. $status = opcache_get_status();
  30. print_r(count($status['scripts']));
  31. ?>
  32. --EXPECTF--
  33. Array
  34. (
  35. [0] => /path/to/foo
  36. [1] => /path/to/foo2
  37. [2] => /path/to/bar
  38. [3] => __DIR__/blacklist.inc
  39. [4] => __DIR__/current.php
  40. [5] => %S/tmp/path/?nocache.inc
  41. [6] => %S/tmp/path/*/somedir
  42. )
  43. ok
  44. 1