From: Henry S. <kel...@ph...> - 2009-08-04 15:34:50
|
Author: Kellanved Date: Tue Aug 4 16:34:04 2009 New Revision: 9920 Log: add the option to place image debugging information to the log Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php branches/phpBB-3_0_0/phpBB/language/en/acp/common.php Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions.php Tue Aug 4 16:34:04 2009 *************** *** 3465,3472 **** // remove complete path to installation, with the risk of changing backslashes meant to be there $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile); $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); - echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n"; // echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n"; } --- 3465,3477 ---- // remove complete path to installation, with the risk of changing backslashes meant to be there $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile); $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n"; + + // we are writing an image - the user won't see the debug, so let's place it in the log + if (defined('IMAGE_OUTPUT')) + { + add_log('critical', 'LOG_IMAGE_GENERATION_ERROR', $errfile, $errline, $msg_text); + } // echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n"; } Modified: branches/phpBB-3_0_0/phpBB/language/en/acp/common.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/acp/common.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/acp/common.php Tue Aug 4 16:34:04 2009 *************** *** 574,579 **** --- 574,581 ---- 'LOG_USERS_APPROVED' => '<strong>Users approved in usergroup</strong> %1$s<br />» %2$s', 'LOG_USERS_PENDING' => '<strong>Users requested to join group â%1$sâ and need to be approved</strong><br />» %2$s', + 'LOG_IMAGE_GENERATION_ERROR' => '<strong>Error while creating image</strong><br />» Error in %1$s on line %2$s: %3$s', + 'LOG_IMAGESET_ADD_DB' => '<strong>Added new imageset to database</strong><br />» %s', 'LOG_IMAGESET_ADD_FS' => '<strong>Add new imageset on filesystem</strong><br />» %s', 'LOG_IMAGESET_DELETE' => '<strong>Deleted imageset</strong><br />» %s', |