From: Dmitry Stogov Date: Wed, 16 Nov 2016 20:19:56 +0000 (+0300) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.0.14RC1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71ee641327539c3f681c6c333e69f2531efacc3c;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: "opcache.validate_root" is useless on Windows --- 71ee641327539c3f681c6c333e69f2531efacc3c diff --cc ext/opcache/ZendAccelerator.h index 976dae2074,a13c15c55d..1ad3538071 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@@ -203,9 -231,11 +203,11 @@@ typedef struct _zend_accel_directives zend_bool inherited_hack; zend_bool enable_cli; zend_bool validate_permission; + #ifndef ZEND_WIN32 zend_bool validate_root; + #endif - unsigned long revalidate_freq; - unsigned long file_update_protection; + zend_ulong revalidate_freq; + zend_ulong file_update_protection; char *error_log; #ifdef ZEND_WIN32 char *mmap_base; diff --cc ext/opcache/zend_accelerator_module.c index e331d042bd,5705ed79e9..a7cf5c386e --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@@ -687,58 -661,56 +689,60 @@@ static ZEND_FUNCTION(opcache_get_config array_init(return_value); /* directives */ - MAKE_STD_ZVAL(directives); - array_init(directives); - add_assoc_bool(directives, "opcache.enable", ZCG(enabled)); - add_assoc_bool(directives, "opcache.enable_cli", ZCG(accel_directives).enable_cli); - add_assoc_bool(directives, "opcache.use_cwd", ZCG(accel_directives).use_cwd); - add_assoc_bool(directives, "opcache.validate_timestamps", ZCG(accel_directives).validate_timestamps); - add_assoc_bool(directives, "opcache.validate_permission", ZCG(accel_directives).validate_permission); + array_init(&directives); + add_assoc_bool(&directives, "opcache.enable", ZCG(enabled)); + add_assoc_bool(&directives, "opcache.enable_cli", ZCG(accel_directives).enable_cli); + add_assoc_bool(&directives, "opcache.use_cwd", ZCG(accel_directives).use_cwd); + add_assoc_bool(&directives, "opcache.validate_timestamps", ZCG(accel_directives).validate_timestamps); + add_assoc_bool(&directives, "opcache.validate_permission", ZCG(accel_directives).validate_permission); ++#ifndef ZEND_WIN32 + add_assoc_bool(&directives, "opcache.validate_root", ZCG(accel_directives).validate_root); ++#endif + add_assoc_bool(&directives, "opcache.inherited_hack", ZCG(accel_directives).inherited_hack); + add_assoc_bool(&directives, "opcache.dups_fix", ZCG(accel_directives).ignore_dups); + add_assoc_bool(&directives, "opcache.revalidate_path", ZCG(accel_directives).revalidate_path); + + add_assoc_long(&directives, "opcache.log_verbosity_level", ZCG(accel_directives).log_verbosity_level); + add_assoc_long(&directives, "opcache.memory_consumption", ZCG(accel_directives).memory_consumption); + add_assoc_long(&directives, "opcache.interned_strings_buffer",ZCG(accel_directives).interned_strings_buffer); + add_assoc_long(&directives, "opcache.max_accelerated_files", ZCG(accel_directives).max_accelerated_files); + add_assoc_double(&directives, "opcache.max_wasted_percentage", ZCG(accel_directives).max_wasted_percentage); + add_assoc_long(&directives, "opcache.consistency_checks", ZCG(accel_directives).consistency_checks); + add_assoc_long(&directives, "opcache.force_restart_timeout", ZCG(accel_directives).force_restart_timeout); + add_assoc_long(&directives, "opcache.revalidate_freq", ZCG(accel_directives).revalidate_freq); + add_assoc_string(&directives, "opcache.preferred_memory_model", STRING_NOT_NULL(ZCG(accel_directives).memory_model)); + add_assoc_string(&directives, "opcache.blacklist_filename", STRING_NOT_NULL(ZCG(accel_directives).user_blacklist_filename)); + add_assoc_long(&directives, "opcache.max_file_size", ZCG(accel_directives).max_file_size); + add_assoc_string(&directives, "opcache.error_log", STRING_NOT_NULL(ZCG(accel_directives).error_log)); + + add_assoc_bool(&directives, "opcache.protect_memory", ZCG(accel_directives).protect_memory); + add_assoc_bool(&directives, "opcache.save_comments", ZCG(accel_directives).save_comments); + add_assoc_bool(&directives, "opcache.fast_shutdown", ZCG(accel_directives).fast_shutdown); + add_assoc_bool(&directives, "opcache.enable_file_override", ZCG(accel_directives).file_override_enabled); + add_assoc_long(&directives, "opcache.optimization_level", ZCG(accel_directives).optimization_level); + #ifndef ZEND_WIN32 - add_assoc_bool(directives, "opcache.validate_root", ZCG(accel_directives).validate_root); + add_assoc_string(&directives, "opcache.lockfile_path", STRING_NOT_NULL(ZCG(accel_directives).lockfile_path)); #endif - add_assoc_bool(directives, "opcache.inherited_hack", ZCG(accel_directives).inherited_hack); - add_assoc_bool(directives, "opcache.dups_fix", ZCG(accel_directives).ignore_dups); - add_assoc_bool(directives, "opcache.revalidate_path", ZCG(accel_directives).revalidate_path); - - add_assoc_long(directives, "opcache.log_verbosity_level", ZCG(accel_directives).log_verbosity_level); - add_assoc_long(directives, "opcache.memory_consumption", ZCG(accel_directives).memory_consumption); -#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO - add_assoc_long(directives, "opcache.interned_strings_buffer",ZCG(accel_directives).interned_strings_buffer); + +#ifdef HAVE_OPCACHE_FILE_CACHE + add_assoc_string(&directives, "opcache.file_cache", ZCG(accel_directives).file_cache ? ZCG(accel_directives).file_cache : ""); + add_assoc_bool(&directives, "opcache.file_cache_only", ZCG(accel_directives).file_cache_only); + add_assoc_bool(&directives, "opcache.file_cache_consistency_checks", ZCG(accel_directives).file_cache_consistency_checks); #endif - add_assoc_long(directives, "opcache.max_accelerated_files", ZCG(accel_directives).max_accelerated_files); - add_assoc_double(directives, "opcache.max_wasted_percentage", ZCG(accel_directives).max_wasted_percentage); - add_assoc_long(directives, "opcache.consistency_checks", ZCG(accel_directives).consistency_checks); - add_assoc_long(directives, "opcache.force_restart_timeout", ZCG(accel_directives).force_restart_timeout); - add_assoc_long(directives, "opcache.revalidate_freq", ZCG(accel_directives).revalidate_freq); - add_assoc_string(directives, "opcache.preferred_memory_model", STRING_NOT_NULL(ZCG(accel_directives).memory_model), 1); - add_assoc_string(directives, "opcache.blacklist_filename", STRING_NOT_NULL(ZCG(accel_directives).user_blacklist_filename), 1); - add_assoc_long(directives, "opcache.max_file_size", ZCG(accel_directives).max_file_size); - add_assoc_string(directives, "opcache.error_log", STRING_NOT_NULL(ZCG(accel_directives).error_log), 1); - - add_assoc_bool(directives, "opcache.protect_memory", ZCG(accel_directives).protect_memory); - add_assoc_bool(directives, "opcache.save_comments", ZCG(accel_directives).save_comments); - add_assoc_bool(directives, "opcache.load_comments", ZCG(accel_directives).load_comments); - add_assoc_bool(directives, "opcache.fast_shutdown", ZCG(accel_directives).fast_shutdown); - add_assoc_bool(directives, "opcache.enable_file_override", ZCG(accel_directives).file_override_enabled); - add_assoc_long(directives, "opcache.optimization_level", ZCG(accel_directives).optimization_level); - - add_assoc_zval(return_value, "directives", directives); + + add_assoc_zval(return_value, "directives", &directives); /*version */ - MAKE_STD_ZVAL(version); - array_init(version); - add_assoc_string(version, "version", ACCELERATOR_VERSION, 1); - add_assoc_string(version, "opcache_product_name", ACCELERATOR_PRODUCT_NAME, 1); - add_assoc_zval(return_value, "version", version); + array_init(&version); + add_assoc_string(&version, "version", PHP_VERSION); + add_assoc_string(&version, "opcache_product_name", ACCELERATOR_PRODUCT_NAME); + add_assoc_zval(return_value, "version", &version); /* blacklist */ - MAKE_STD_ZVAL(blacklist); - array_init(blacklist); - zend_accel_blacklist_apply(&accel_blacklist, (apply_func_arg_t) add_blacklist_path, blacklist TSRMLS_CC); - add_assoc_zval(return_value, "blacklist", blacklist); + array_init(&blacklist); + zend_accel_blacklist_apply(&accel_blacklist, add_blacklist_path, &blacklist); + add_assoc_zval(return_value, "blacklist", &blacklist); } /* {{{ proto void accelerator_reset()