diff options
Diffstat (limited to 'ext/opcache/zend_accelerator_module.c')
-rw-r--r-- | ext/opcache/zend_accelerator_module.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 81dc6d6875..b8a3410895 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -80,13 +80,13 @@ static zend_function_entry accel_functions[] = { /* Private functions */ ZEND_FE(opcache_get_configuration, arginfo_opcache_none) ZEND_FE(opcache_get_status, arginfo_opcache_get_status) - { NULL, NULL, NULL, 0, 0 } + ZEND_FE_END }; static int validate_api_restriction(void) { if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) { - int len = strlen(ZCG(accel_directives).restrict_api); + size_t len = strlen(ZCG(accel_directives).restrict_api); if (!SG(request_info).path_translated || strlen(SG(request_info).path_translated) < len || @@ -200,7 +200,7 @@ static ZEND_INI_MH(OnUpdateMaxWastedPercentage) percentage = 5; zend_accel_error(ACCEL_LOG_WARNING, "opcache.max_wasted_percentage must be set between 1 and 50.\n"); - zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use 5%.\n"); + zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use 5%%.\n"); if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives), "opcache.max_wasted_percentage", sizeof("opcache.max_wasted_percentage")-1)) == NULL) { @@ -294,6 +294,7 @@ ZEND_INI_BEGIN() STD_PHP_INI_ENTRY("opcache.fast_shutdown" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.fast_shutdown, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals, accel_globals) + STD_PHP_INI_ENTRY("opcache.opt_debug_level" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.opt_debug_level, zend_accel_globals, accel_globals) STD_PHP_INI_BOOLEAN("opcache.enable_file_override" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_override_enabled, zend_accel_globals, accel_globals) STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals) @@ -473,33 +474,33 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS) char buf[32]; php_info_print_table_row(2, "Startup", "OK"); php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model()); - snprintf(buf, sizeof(buf), "%pd", (zend_ulong)ZCSG(hits)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, (zend_ulong)ZCSG(hits)); php_info_print_table_row(2, "Cache hits", buf); - snprintf(buf, sizeof(buf), "%pd", ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses)); php_info_print_table_row(2, "Cache misses", buf); snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory)); php_info_print_table_row(2, "Used memory", buf); - snprintf(buf, sizeof(buf), "%pd", zend_shared_alloc_get_free_memory()); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, zend_shared_alloc_get_free_memory()); php_info_print_table_row(2, "Free memory", buf); - snprintf(buf, sizeof(buf), "%pd", ZSMMG(wasted_shared_memory)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZSMMG(wasted_shared_memory)); php_info_print_table_row(2, "Wasted memory", buf); if (ZCSG(interned_strings_start) && ZCSG(interned_strings_end) && ZCSG(interned_strings_top)) { - snprintf(buf, sizeof(buf), "%pd", ZCSG(interned_strings_top) - ZCSG(interned_strings_start)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(interned_strings_top) - ZCSG(interned_strings_start)); php_info_print_table_row(2, "Interned Strings Used memory", buf); - snprintf(buf, sizeof(buf), "%pd", ZCSG(interned_strings_end) - ZCSG(interned_strings_top)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(interned_strings_end) - ZCSG(interned_strings_top)); php_info_print_table_row(2, "Interned Strings Free memory", buf); } - snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).num_direct_entries); + snprintf(buf, sizeof(buf), "%d", ZCSG(hash).num_direct_entries); php_info_print_table_row(2, "Cached scripts", buf); - snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).num_entries); + snprintf(buf, sizeof(buf), "%d", ZCSG(hash).num_entries); php_info_print_table_row(2, "Cached keys", buf); - snprintf(buf, sizeof(buf), "%pd", ZCSG(hash).max_num_entries); + snprintf(buf, sizeof(buf), "%d", ZCSG(hash).max_num_entries); php_info_print_table_row(2, "Max keys", buf); - snprintf(buf, sizeof(buf), "%pd", ZCSG(oom_restarts)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(oom_restarts)); php_info_print_table_row(2, "OOM restarts", buf); - snprintf(buf, sizeof(buf), "%pd", ZCSG(hash_restarts)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(hash_restarts)); php_info_print_table_row(2, "Hash keys restarts", buf); - snprintf(buf, sizeof(buf), "%pd", ZCSG(manual_restarts)); + snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(manual_restarts)); php_info_print_table_row(2, "Manual restarts", buf); } } @@ -555,7 +556,7 @@ static int accelerator_get_scripts(zval *return_value) script = (zend_persistent_script *)cache_entry->data; array_init(&persistent_script_report); - add_assoc_str(&persistent_script_report, "full_path", zend_string_dup(script->full_path, 0)); + add_assoc_str(&persistent_script_report, "full_path", zend_string_dup(script->script.filename, 0)); add_assoc_long(&persistent_script_report, "hits", (zend_long)script->dynamic_members.hits); add_assoc_long(&persistent_script_report, "memory_consumption", script->dynamic_members.memory_consumption); ta = localtime(&script->dynamic_members.last_used); |