diff options
author | rxu <rxu@mail.ru> | 2014-08-09 20:40:26 +0800 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2014-08-09 23:02:36 +0800 |
commit | 917cd4dec7157845f82516ef440a51dc05d6799d (patch) | |
tree | e45abe9198bedff2709e4bb532ec34fff2287c63 /phpBB/includes | |
parent | 20b8ea947c656382871831ee83acd5de8fcd5040 (diff) | |
download | forums-917cd4dec7157845f82516ef440a51dc05d6799d.tar forums-917cd4dec7157845f82516ef440a51dc05d6799d.tar.gz forums-917cd4dec7157845f82516ef440a51dc05d6799d.tar.bz2 forums-917cd4dec7157845f82516ef440a51dc05d6799d.tar.xz forums-917cd4dec7157845f82516ef440a51dc05d6799d.zip |
[ticket/12943] Add core.phpbb_generate_debug_output core event
Add core.phpbb_generate_debug_output core event to allow extensions
outputting additional debug info.
PHPBB3-12943
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 16 | ||||
-rw-r--r-- | phpBB/includes/functions_acp.php | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4318b20b97..bd0a5795b1 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -5095,9 +5095,10 @@ function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $re * @param \phpbb\config\config $config Config object * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\user $user User object +* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher * @return string */ -function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user) +function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher) { $debug_info = array(); @@ -5136,6 +5137,17 @@ function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpb } } + /** + * Modify debug output information + * + * @event core.phpbb_generate_debug_output + * @var array debug_info Array of strings with debug information + * + * @since 3.1.0-RC3 + */ + $vars = array('debug_info'); + extract($phpbb_dispatcher->trigger_event('core.phpbb_generate_debug_output', compact($vars))); + return implode(' | ', $debug_info); } @@ -5174,7 +5186,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler = phpbb_check_and_display_sql_report($request, $auth, $db); $template->assign_vars(array( - 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user), + 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited'), diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index abf726581d..dc3d745d53 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -149,7 +149,7 @@ function adm_page_footer($copyright_html = true) phpbb_check_and_display_sql_report($request, $auth, $db); $template->assign_vars(array( - 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user), + 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited'), |