xref: /php-src/ext/opcache/tests/bug78185.phpt (revision bca5f6e7)
1--TEST--
2Bug #78185: file cache only no longer works
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.file_cache={PWD}
8opcache.file_cache_only=1
9opcache.jit=0
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14if (substr(PHP_OS, 0, 3) !== 'WIN') {
15    $pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
16} else {
17    $pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
18}
19foreach (glob($pattern) as $p) {
20    var_dump($p);
21}
22?>
23--CLEAN--
24<?php
25if (substr(PHP_OS, 0, 3) !== 'WIN') {
26    $pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
27} else {
28    $pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
29}
30foreach (glob($pattern) as $p) {
31    unlink($p);
32    $p = dirname($p);
33    while(strlen($p) > strlen(__DIR__)) {
34        rmdir($p);
35        $p = dirname($p);
36    }
37}
38?>
39--EXPECTF--
40string(%d) "%s78185.php.bin"
41
42