Index: trunk/core/kernel/utility/debugger.php =================================================================== diff -u -N -r8413 -r8436 --- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 8413) +++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 8436) @@ -104,7 +104,7 @@ * * @param string $ip_list semi-column (by default) separated ip address list * @param string $separator ip address separator (default ";") - * + * * @return bool */ function ipMatch($ip_list, $separator = ';') @@ -117,10 +117,10 @@ break; } } - + return $ip_match; } - + /** * Set's default values to constants debugger uses * @@ -265,16 +265,16 @@ { $dump_mode = 'var_dump'; $dumpVars = func_get_args(); - + if ($dumpVars[count($dumpVars) - 1] === 'STRICT') { $dump_mode = 'strict_var_dump'; array_pop($dumpVars); } - + foreach ($dumpVars as $varValue) { $this->Data[] = Array('value' => $varValue, 'debug_type' => $dump_mode); } - + } function prepareHTML($dataIndex) @@ -299,7 +299,7 @@ case 'strict_var_dump': return $this->highlightString( var_export($Data['value'], true) ); break; - + case 'trace': ini_set('memory_limit', '500M'); $trace =& $Data['trace']; @@ -344,19 +344,29 @@ $total = $this->ProfilerTotals[$totals_key]; $div_width = Array(); - $total_width = ($this->getWindowWidth()-10); + $total_width = ($this->getWindowWidth() - 10); $div_width['before'] = round(($total_before / $total) * $total_width); $div_width['current'] = round(($runtime / $total) * $total_width); $div_width['left'] = round((($total - $total_before - $runtime) / $total) * $total_width); $ret = 'Name: '.$Data['description'].'
'; + $additional = isset($Data['additional']) ? $Data['additional'] : Array (); if (isset($Data['file'])) { + array_unshift($additional, Array('name' => 'File', 'value' => $this->getFileLink($Data['file'], $Data['line'], basename($Data['file']).':'.$Data['line']))); + } + array_unshift($additional, Array('name' => 'Runtime', 'value' => $runtime.'s')); + + foreach ($additional as $mixed_param) { + $ret .= '['.$mixed_param['name'].': '.$mixed_param['value'].'] '; + } + + /*if (isset($Data['file'])) { $ret .= '[Runtime: '.$runtime.'s] [File: '.$this->getFileLink($Data['file'], $Data['line'], basename($Data['file']).':'.$Data['line']).']
'; } else { - $ret .= 'Runtime: '.$runtime.'s
'; - } + $ret .= 'Runtime: '.$runtime.'s
'; + }*/ $ret .= '
'; $ret .= '
'; @@ -422,11 +432,11 @@ case 'NULL': return 'NULL'."\n"; break; - + case 'object': return $this->processObject($array, $tab_count); break; - + default: // number or string if (strlen($array) > 200) { @@ -436,9 +446,9 @@ break; } } - + $output = ''; - + $tab_count++; $output .= "Array\n".str_repeat(' ', $tab_count)."(\n"; @@ -484,7 +494,7 @@ } $tab_count--; - $output .= str_repeat(' ', $tab_count).")\n"; + $output .= str_repeat(' ', $tab_count).")\n"; if ($first_line) { $first_line = false; @@ -510,15 +520,15 @@ if ($this->IsBigObject($object)) { return 'SKIPPED (class: '.$object_class.")\n"; } - + $attribute_names = get_class_vars($object_class); if (!$attribute_names) { return "NO_ATTRIBUTES\n"; } else { $output = ''; array_push($this->RecursionStack, $object_class); - + $tabsign = $tab_count ? str_repeat(' ', $tab_count) : ''; foreach ($attribute_names as $attribute_name => $attribute_value) { if (is_object($object->$attribute_name)) { @@ -783,6 +793,19 @@ if (isset($description)) { $this->ProfilerData[$key]['description'] = $description; } + + if (substr($key, 0, 4) == 'sql_') { + $func_arguments = func_get_args(); + $rows_affected = $func_arguments[3]; + + if ($rows_affected > 0) { + $additional = Array ( + Array ('name' => 'Affected Rows', 'value' => $rows_affected), + ); + + $this->ProfilerData[$key]['additional'] =& $additional; + } + } } function profilerAddTotal($total_key, $key = null, $value = null) @@ -843,7 +866,7 @@ if (defined('E_RECOVERABLE_ERROR')) { $error_map['Fatal Error (recoverable)'] = Array(E_RECOVERABLE_ERROR); } - + foreach ($error_map as $error_name => $error_codes) { if (in_array($error_code, $error_codes)) { return $error_name;