com php-src: Merge branch 'PHP-7.3' into PHP-7.4: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/zend_accelerator_module.c
| From: | Dmitry Stogov | Date: | Tue, 14 May 2019 12:09:17 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.3' into PHP-7.4: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/zend_accelerator_module.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106185@lists.php.net to get a copy of this message | ||
Commit: 7bc4bd0229d792718fd8d9aef1fed710d24607b5
Author: Dmitry Stogov <dmitry@zend.com> Tue, 14 May 2019 15:09:17 +0300
Parents: 2244a7d9afe89979b0d33e6665784996a11ad820 bb7ecb87043c0d1f3def5a56d2e5bd7fff3f77cb
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7bc4bd0229d792718fd8d9aef1fed710d24607b5
Log:
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Moved NEWS entry
Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset
Changed paths:
MM ext/opcache/ZendAccelerator.c
MM ext/opcache/ZendAccelerator.h
MM ext/opcache/zend_accelerator_module.c
Diff:
diff --cc ext/opcache/ZendAccelerator.c
index 7d578c0,a8ea054..58baf76
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@@ -1879,10 -1906,13 +1879,10 @@@ zend_op_array *persistent_compile_file(
if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
/* The Accelerator is disabled, act as if without the Accelerator */
return accelerator_orig_compile_file(file_handle, type);
-#ifdef HAVE_OPCACHE_FILE_CACHE
} else if (file_cache_only) {
return file_cache_compile_file(file_handle, type);
- } else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
-#endif
+ } else if (!ZCG(accelerator_enabled) ||
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
-#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
return file_cache_compile_file(file_handle, type);
}
@@@ -2168,10 -2205,11 +2168,8 @@@ static int persistent_stream_open_funct
/* zend_resolve_path() replacement for PHP 5.3 and above */
static zend_string* persistent_zend_resolve_path(const char *filename, size_t filename_len)
{
- if (ZCG(enabled) && accel_startup_ok &&
- if (
-#ifdef HAVE_OPCACHE_FILE_CACHE
-- !file_cache_only &&
- (ZCG(counted) || ZCSG(accelerator_enabled)) &&
- !ZCSG(restart_in_progress)) {
-#endif
++ if (!file_cache_only &&
+ ZCG(accelerator_enabled)) {
/* check if callback is called from include_once or it's a main request */
if ((!EG(current_execute_data) &&
@@@ -2313,7 -2358,8 +2311,8 @@@ int accel_activate(INIT_FUNC_ARGS
zend_alter_ini_entry_chars(key, "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME);
zend_string_release_ex(key, 0);
zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with
too big inode");
+ ZCG(accelerator_enabled) = 0;
- return;
+ return SUCCESS;
}
}
}
@@@ -2391,15 -2436,11 +2393,17 @@@
realpath_cache_clean();
accel_reset_pcre_cache();
+ ZCG(pcre_reseted) = 0;
} else if (reset_pcre) {
accel_reset_pcre_cache();
+ ZCG(pcre_reseted) = 1;
}
+
+ if (ZCSG(preload_script)) {
+ preload_activate();
+ }
+
+ return SUCCESS;
}
int accel_post_deactivate(void)
diff --cc ext/opcache/zend_accelerator_module.c
index f013fb9,5b43a55..fd35098
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@@ -433,9 -438,13 +433,7 @@@ void zend_accel_info(ZEND_MODULE_INFO_F
{
php_info_print_table_start();
- if (ZCG(enabled) && accel_startup_ok &&
- ((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
- if (
-#ifdef HAVE_OPCACHE_FILE_CACHE
- (ZCG(accelerator_enabled) || file_cache_only)
-#else
- (ZCG(accelerator_enabled))
-#endif
-- ) {
++ if (ZCG(accelerator_enabled) || file_cache_only) {
php_info_print_table_row(2, "Opcode Caching", "Up and Running");
} else {
php_info_print_table_row(2, "Opcode Caching", "Disabled");
@@@ -597,8 -608,9 +595,8 @@@ static ZEND_FUNCTION(opcache_get_status
array_init(return_value);
/* Trivia */
- add_assoc_bool(return_value, "opcache_enabled", ZCG(enabled) && (ZCG(counted)
|| ZCSG(accelerator_enabled)));
+ add_assoc_bool(return_value, "opcache_enabled", ZCG(accelerator_enabled));
-#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
add_assoc_string(return_value, "file_cache", ZCG(accel_directives).file_cache);
}