Skip to content

Commit

Permalink
fix for file_cache_only
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacarpet committed Dec 3, 2024
1 parent f620d9c commit 6be025b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ext/opcache/tests/gh16551_099.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ var_dump(
--CLEAN--
<?php
if (substr(PHP_OS, 0, 3) !== 'WIN') {
$pattern = __DIR__ . '/*/' . __DIR__ . '/*16551_999.inc.bin';
$pattern = __DIR__ . '/*/' . __DIR__ . '/*16551*.bin';
} else {
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*16551_999.inc.bin';
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*16551*.bin';
}
foreach (glob($pattern) as $p) {
unlink($p);
$p = dirname($p);
while(strlen($p) > strlen(__DIR__)) {
rmdir($p);
@rmdir($p);
$p = dirname($p);
}
}
Expand Down
7 changes: 6 additions & 1 deletion ext/opcache/zend_accelerator_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,12 @@ ZEND_FUNCTION(opcache_is_script_cached_in_file_cache)
RETURN_FALSE;
}

if (!ZCG(accelerator_enabled) || !ZCG(accel_directives).file_cache) {
// account for accelerator_enabled = false when file_cache_only = true
if (!(ZCG(accelerator_enabled) || ZCG(accel_directives).file_cache_only)) {
RETURN_FALSE;
}

if (!ZCG(accel_directives).file_cache) {
RETURN_FALSE;
}

Expand Down

0 comments on commit 6be025b

Please sign in to comment.