X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplbacktrace.php;h=29685121fcb8a5bfe8c08ebfce71a848516c3fc5;hb=f23d33e1b114e9032b4b966baebdeb14b4215313;hp=64278965d1548b2bca96603ba4fa21c9d5c3559e;hpb=d3f26be98b879dc9df9be60fffe2f1e152b3b218;p=platal.git diff --git a/classes/plbacktrace.php b/classes/plbacktrace.php index 6427896..2968512 100644 --- a/classes/plbacktrace.php +++ b/classes/plbacktrace.php @@ -1,6 +1,6 @@ fixCharset($entry['action']); unset($entry['action']); $trace['exectime'] = @$entry[$timef]; $this->totaltime += $trace['exectime']; unset($entry[$timef]); $trace['rows'] = @$entry[$sizef]; unset($entry[$sizef]); - $trace['error'] = @$entry[$errorf]; + $trace['error'] = $this->fixCharset(@$entry[$errorf]); unset($entry[$errorf]); if ($trace['error']) { $this->error = true; } - $trace['data'] = array($entry); + $trace['data'] = array($this->fixCharset($entry)); $this->traces[] =& $trace; } public function newEvent($action, $rows = 0, $error = null, array $userdata = array()) { - $trace = array('action' => $action, 'time' => 0); + $trace = array('action' => $this->fixCharset($action), 'time' => 0); $this->traces[] =& $trace; $this->update($rows, $error, $userdata); } public function start($action) { - $trace = array('action' => $action, 'starttime' => microtime(true)); - $this->traces[] =& $trace; + $this->traces[] = array('action' => $this->fixCharset($action), 'starttime' => microtime(true));; } public function stop($rows = 0, $error = null, array $userdata = array()) @@ -76,9 +84,9 @@ class PlBacktrace return; } $trace =& $this->traces[count($this->traces) - 1]; - $trace['time'] = $time - $trace['starttime']; + $trace['exectime'] = $time - $trace['starttime']; unset($trace['starttime']); - $this->totaltime += $trace['time']; + $this->totaltime += $trace['exectime']; $this->update($rows, $error, $userdata); } @@ -86,7 +94,8 @@ class PlBacktrace { $trace =& $this->traces[count($this->traces) - 1]; $trace['rows'] = $rows; - $trace['error'] = $error; + $trace['error'] = $this->fixCharset($error); + array_walk_recursive($userdata, array($this, 'fixCharset')); $trace['data'] = $userdata; if ($trace['error']) { $this->error = true;