|
From: MW <jo...@us...> - 2008-02-11 14:03:10
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10631/includes Modified Files: mx_functions_tools.php Log Message: code styling: we use tabs and NOT spaces to indent code. Missing braces Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** mx_functions_tools.php 9 Feb 2008 20:13:01 -0000 1.20 --- mx_functions_tools.php 11 Feb 2008 14:03:06 -0000 1.21 *************** *** 4356,4382 **** function printR($var) { ! while (ob_get_level()) { ob_end_clean(); } ! if (func_num_args() > 1) $var = func_get_args(); ! ! echo '<pre>'; ! $trace = array_shift((debug_backtrace())); ! echo "<b>Debugging <font color=red>".basename($trace['file'])."</font> on line <font color=red>{$trace['line']}</font></b>:\r\n"; ! $file = file($trace['file']); ! echo "<div style='background: #f5f5f5; padding: 0.2em 0em;'>".htmlspecialchars($file[$trace['line']-1])."</div>\r\n"; ! echo '<b>Type</b>: '.gettype($var)."\r\n"; ! if (is_string($var)) echo "<b>Length</b>: ".strlen($var)."\r\n"; ! if (is_array($var)) echo "<b>Length</b>: ".count($var)."\r\n"; ! echo '<b>Value</b>: '; ! if (is_string($var)) echo htmlspecialchars($var); ! else { ! $print_r = print_r($var, true); ! // str_contains < or > ! if ((strstr($print_r, '<') !== false) || (strstr($print_r, '>') !== false)) { ! $print_r = htmlspecialchars($print_r); ! } ! echo $print_r; ! } ! echo '</pre>'; ! exit; } } --- 4356,4399 ---- function printR($var) { ! while (ob_get_level()) ! { ! ob_end_clean(); ! } ! if (func_num_args() > 1) ! { ! $var = func_get_args(); ! } ! ! echo '<pre>'; ! $trace = array_shift((debug_backtrace())); ! echo "<b>Debugging <font color=red>".basename($trace['file'])."</font> on line <font color=red>{$trace['line']}</font></b>:\r\n"; ! $file = file($trace['file']); ! echo "<div style='background: #f5f5f5; padding: 0.2em 0em;'>".htmlspecialchars($file[$trace['line']-1])."</div>\r\n"; ! echo '<b>Type</b>: '.gettype($var)."\r\n"; ! if (is_string($var)) ! { ! echo "<b>Length</b>: ".strlen($var)."\r\n"; ! } ! if (is_array($var)) ! { ! echo "<b>Length</b>: ".count($var)."\r\n"; ! } ! echo '<b>Value</b>: '; ! if (is_string($var)) ! { ! echo htmlspecialchars($var); ! } ! else ! { ! $print_r = print_r($var, true); ! // str_contains < or > ! if ((strstr($print_r, '<') !== false) || (strstr($print_r, '>') !== false)) ! { ! $print_r = htmlspecialchars($print_r); ! } ! echo $print_r; ! } ! echo '</pre>'; ! exit; } } |