Skip to content

Commit 86e5178

Browse files
committed
opcache: file_cache_read_only code review update 3 (#16484)
1 parent 1197a96 commit 86e5178

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ext/opcache/zend_accelerator_module.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ static ZEND_INI_MH(OnEnable)
160160
}
161161
}
162162

163+
static ZEND_INI_MH(OnUpdateFileCache)
164+
{
165+
if (new_value) {
166+
if (!ZSTR_LEN(new_value)) {
167+
new_value = NULL;
168+
}
169+
}
170+
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
171+
return SUCCESS;
172+
}
173+
163174
#ifdef HAVE_JIT
164175
static ZEND_INI_MH(OnUpdateJit)
165176
{
@@ -286,7 +297,7 @@ ZEND_INI_BEGIN()
286297
STD_PHP_INI_ENTRY("opcache.mmap_base", NULL, PHP_INI_SYSTEM, OnUpdateString, accel_directives.mmap_base, zend_accel_globals, accel_globals)
287298
#endif
288299

289-
STD_PHP_INI_ENTRY("opcache.file_cache" , NULL , PHP_INI_SYSTEM, OnUpdateStringUnempty, accel_directives.file_cache, zend_accel_globals, accel_globals)
300+
STD_PHP_INI_ENTRY("opcache.file_cache" , NULL , PHP_INI_SYSTEM, OnUpdateFileCache, accel_directives.file_cache, zend_accel_globals, accel_globals)
290301
STD_PHP_INI_BOOLEAN("opcache.file_cache_read_only" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_cache_read_only, zend_accel_globals, accel_globals)
291302
STD_PHP_INI_BOOLEAN("opcache.file_cache_only" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_cache_only, zend_accel_globals, accel_globals)
292303
STD_PHP_INI_BOOLEAN("opcache.file_cache_consistency_checks" , "1" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_cache_consistency_checks, zend_accel_globals, accel_globals)

0 commit comments

Comments
 (0)