summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_accelerator_module.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-03-05 16:01:43 +0300
committerDmitry Stogov <dmitry@zend.com>2018-03-05 16:01:43 +0300
commit350082ed7146fd889d04c8864d8d649bea73dd01 (patch)
tree46346a44f9670144e97088251f5e3180f693c710 /ext/opcache/zend_accelerator_module.c
parenta827aefe47dafed918c5e57a7e9e92ac52378792 (diff)
downloadphp-git-350082ed7146fd889d04c8864d8d649bea73dd01.tar.gz
Fixed "opcache.file_cache_fallback" mode.
It's not safe to change value of ZCG(accel_directives).file_cache_only, becuse it might be altered by INI subsystem. Use global variable instead.
Diffstat (limited to 'ext/opcache/zend_accelerator_module.c')
-rw-r--r--ext/opcache/zend_accelerator_module.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index b7c24c377e..6c953abc55 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -406,7 +406,7 @@ void zend_accel_override_file_functions(void)
zend_function *old_function;
if (ZCG(enabled) && accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
#ifdef HAVE_OPCACHE_FILE_CACHE
- if (ZCG(accel_directives).file_cache_only) {
+ if (file_cache_only) {
zend_accel_error(ACCEL_LOG_WARNING, "file_override_enabled has no effect when file_cache_only is set");
return;
}
@@ -442,7 +442,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
if (ZCG(enabled) && accel_startup_ok &&
#ifdef HAVE_OPCACHE_FILE_CACHE
- ((ZCG(counted) || ZCSG(accelerator_enabled)) || ZCG(accel_directives).file_cache_only)
+ ((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
#else
(ZCG(counted) || ZCSG(accelerator_enabled))
#endif
@@ -457,7 +457,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
php_info_print_table_row(2, "Optimization", "Disabled");
}
#ifdef HAVE_OPCACHE_FILE_CACHE
- if (!ZCG(accel_directives).file_cache_only) {
+ if (!file_cache_only) {
php_info_print_table_row(2, "SHM Cache", "Enabled");
} else {
php_info_print_table_row(2, "SHM Cache", "Disabled");
@@ -467,7 +467,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
} else {
php_info_print_table_row(2, "File Cache", "Disabled");
}
- if (ZCG(accel_directives).file_cache_only) {
+ if (file_cache_only) {
if (!accel_startup_ok || zps_api_failure_reason) {
php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
} else {
@@ -616,7 +616,7 @@ static ZEND_FUNCTION(opcache_get_status)
if (ZCG(accel_directives).file_cache) {
add_assoc_string(return_value, "file_cache", ZCG(accel_directives).file_cache);
}
- if (ZCG(accel_directives).file_cache_only) {
+ if (file_cache_only) {
add_assoc_bool(return_value, "file_cache_only", 1);
return;
}