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