From cd3ef382e99ba2b0d53d8d9bde8b2029ad7f62ee Mon Sep 17 00:00:00 2001 From: codinghuang Date: Sat, 15 May 2021 09:55:55 +0800 Subject: [PATCH] Add yasd.open_extended_info ini (#129) --- php_yasd.h | 1 + src/base.cc | 4 ++++ yasd.cc | 2 ++ 3 files changed, 7 insertions(+) diff --git a/php_yasd.h b/php_yasd.h index 585a86d..b8b6b0d 100644 --- a/php_yasd.h +++ b/php_yasd.h @@ -36,6 +36,7 @@ ZEND_BEGIN_MODULE_GLOBALS(yasd) uint16_t remote_port; uint16_t depth; int log_level; + int open_extended_info; ssize_t max_executed_opline_num; ssize_t max_executed_milliseconds; diff --git a/src/base.cc b/src/base.cc index 0a40ac7..84d158c 100644 --- a/src/base.cc +++ b/src/base.cc @@ -317,6 +317,10 @@ void yasd_rshutdown(int module_number) { } void yasd_minit(int module_number) { + if (YASD_G(open_extended_info)) { + CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO; + } + replace_execute_ex(); // it seems that -e does not work in PHP-FPM mode. so we need to add ZEND_COMPILE_EXTENDED_INFO ourselves. diff --git a/yasd.cc b/yasd.cc index 3d75671..839659a 100644 --- a/yasd.cc +++ b/yasd.cc @@ -60,6 +60,8 @@ STD_PHP_INI_ENTRY("yasd.max_executed_opline_num", "0", PHP_INI_ALL, OnUpdateLong max_executed_opline_num, zend_yasd_globals, yasd_globals) STD_PHP_INI_ENTRY("yasd.init_file", "", PHP_INI_ALL, OnUpdateStringUnempty, init_file, zend_yasd_globals, yasd_globals) +STD_PHP_INI_ENTRY("yasd.open_extended_info", "0", PHP_INI_ALL, OnUpdateLong, + open_extended_info, zend_yasd_globals, yasd_globals) // compatible with phpstorm STD_PHP_INI_ENTRY("xdebug.coverage_enable", "1", PHP_INI_ALL, OnUpdateLong,