Skip to content

Commit 6be025b

Browse files
committed
fix for file_cache_only
1 parent f620d9c commit 6be025b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

ext/opcache/tests/gh16551_099.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ var_dump(
4949
--CLEAN--
5050
<?php
5151
if (substr(PHP_OS, 0, 3) !== 'WIN') {
52-
$pattern = __DIR__ . '/*/' . __DIR__ . '/*16551_999.inc.bin';
52+
$pattern = __DIR__ . '/*/' . __DIR__ . '/*16551*.bin';
5353
} else {
54-
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*16551_999.inc.bin';
54+
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*16551*.bin';
5555
}
5656
foreach (glob($pattern) as $p) {
5757
unlink($p);
5858
$p = dirname($p);
5959
while(strlen($p) > strlen(__DIR__)) {
60-
rmdir($p);
60+
@rmdir($p);
6161
$p = dirname($p);
6262
}
6363
}

ext/opcache/zend_accelerator_module.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,12 @@ ZEND_FUNCTION(opcache_is_script_cached_in_file_cache)
10371037
RETURN_FALSE;
10381038
}
10391039

1040-
if (!ZCG(accelerator_enabled) || !ZCG(accel_directives).file_cache) {
1040+
// account for accelerator_enabled = false when file_cache_only = true
1041+
if (!(ZCG(accelerator_enabled) || ZCG(accel_directives).file_cache_only)) {
1042+
RETURN_FALSE;
1043+
}
1044+
1045+
if (!ZCG(accel_directives).file_cache) {
10411046
RETURN_FALSE;
10421047
}
10431048

0 commit comments

Comments
 (0)