Index: trunk/kernel/include/debugger.php =================================================================== diff -u -r837 -r842 --- trunk/kernel/include/debugger.php (.../debugger.php) (revision 837) +++ trunk/kernel/include/debugger.php (.../debugger.php) (revision 842) @@ -8,8 +8,8 @@ * @var Array */ var $Data = Array(); + var $ProfilerData = Array(); - function dumpVars() { $dumpVars = func_get_args(); @@ -36,7 +36,7 @@ case 'var_dump': $ret = highlight_string('', true); $ret = preg_replace('/<\?php (.*)\?>/s','$1',$ret); - return $ret; + return addslashes($ret); break; case 'trace': @@ -65,7 +65,13 @@ $ret = preg_replace('/<\?php (.*)\?>/s','$1',$ret);*/ return $ret; break; - + + case 'profiler': + $profileKey = $Data['profile_key']; + $Data =& $this->ProfilerData[$profileKey]; + return 'Name: '.$Data['description'].'. Runtime: '.($Data['ends'] - $Data['begins']); + break; + default: return 'incorrect debug data'; break; @@ -95,6 +101,17 @@ $this->Data[] = Array('html' => $html,'debug_type' => 'html'); } + function profileStart($key, $description) + { + $this->ProfilerData[$key] = Array('begins' => time(), 'debuggerRowID' => count($this->Data), 'description' => $description); + $this->Data[] = array('profile_key' => $key, 'debug_type' => 'profiler'); + } + + function profileFinish($key) + { + $this->ProfilerData[$key]['ends'] = time(); + } + function getErrorNameByCode($errorCode) { switch($errorCode) @@ -127,6 +144,7 @@ { $i = 0; $lineCount = count($this->Data); ?> +