com php-src: Backport 91a6cdbff5ebd1ca4db1d6e8c42d3265ce80ace4: ext/opcache/ZendAccelerator.c
| From: | Remi Collet | Date: | Tue, 18 Jun 2019 05:48:49 +0000 |
| Subject: | com php-src: Backport 91a6cdbff5ebd1ca4db1d6e8c42d3265ce80ace4: ext/opcache/ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106848@lists.php.net to get a copy of this message | ||
Commit: 6c225a63189bd1c0649c709d46112e0bf01f13b2
Author: Dmitry Stogov <dmitry@zend.com> Fri, 14 Jun 2019 13:24:47 +0300
Committer: Remi Collet <remi@php.net> Tue, 18 Jun 2019 07:48:49 +0200
Parents: 42c7d5106b03e0a07cfa6f40ed2d883575d6fcc3
Branches: PHP-7.2.20
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c225a63189bd1c0649c709d46112e0bf01f13b2
Log:
Backport 91a6cdbff5ebd1ca4db1d6e8c42d3265ce80ace4
(cherry picked from commit 40f463b560f7d6cf4ae2c98752837b412a1c65f0)
Changed paths:
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 0d28e9d..91436d5 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -1761,11 +1761,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) ||
@@ -1775,6 +1779,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);
}
@@ -1801,10 +1807,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);
}