diff options
author | Dmitry Stogov <dmitry@zend.com> | 2019-06-14 13:24:47 +0300 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-06-18 09:06:24 +0200 |
commit | b70fcdd841431fb15b390de6a9b4416f99c133ee (patch) | |
tree | 80e830fb04bbb6f6af83e43b9b265dfdb790fcbf | |
parent | a2058937bc5d01b3fda0726348279b6e7296e586 (diff) | |
download | php-git-b70fcdd841431fb15b390de6a9b4416f99c133ee.tar.gz |
Backport 91a6cdbff5ebd1ca4db1d6e8c42d3265ce80ace4
(cherry picked from commit 40f463b560f7d6cf4ae2c98752837b412a1c65f0)
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index d3d72ff147..1bf2148e54 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1907,11 +1907,15 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) int key_length; int from_shared_memory; /* if the script we've got is stored in SHM */ - if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) { + if (!file_handle->filename || !ZCG(accelerator_enabled)) { /* The Accelerator is disabled, act as if without the Accelerator */ + ZCG(cache_opline) = NULL; + ZCG(cache_persistent_script) = NULL; return accelerator_orig_compile_file(file_handle, type); #ifdef HAVE_OPCACHE_FILE_CACHE } else if (file_cache_only) { + ZCG(cache_opline) = NULL; + ZCG(cache_persistent_script) = NULL; return file_cache_compile_file(file_handle, type); #endif } else if (!ZCG(accelerator_enabled) || @@ -1921,6 +1925,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) return file_cache_compile_file(file_handle, type); } #endif + ZCG(cache_opline) = NULL; + ZCG(cache_persistent_script) = NULL; return accelerator_orig_compile_file(file_handle, type); } @@ -1947,10 +1953,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) /* try to find cached script by key */ key = accel_make_persistent_key(file_handle->filename, strlen(file_handle->filename), &key_length); if (!key) { + ZCG(cache_opline) = NULL; + ZCG(cache_persistent_script) = NULL; return accelerator_orig_compile_file(file_handle, type); } persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length); } else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) { + ZCG(cache_opline) = NULL; + ZCG(cache_persistent_script) = NULL; return accelerator_orig_compile_file(file_handle, type); } |