projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix accent sensitivity in autocompletion
[platal.git]
/
classes
/
plbacktrace.php
diff --git
a/classes/plbacktrace.php
b/classes/plbacktrace.php
index
6427896
..
e15a304
100644
(file)
--- a/
classes/plbacktrace.php
+++ b/
classes/plbacktrace.php
@@
-37,36
+37,44
@@
class PlBacktrace
}
}
}
}
+ private function fixCharset($action)
+ {
+ if (!is_string($action)) {
+ return $action;
+ } else {
+ return is_utf8($action) ? $action : utf8_encode($action);
+ }
+ }
+
private function add(array &$entry, $sizef = 'rows', $timef = 'exectime', $errorf = 'error')
{
$trace = array();
private function add(array &$entry, $sizef = 'rows', $timef = 'exectime', $errorf = 'error')
{
$trace = array();
- $trace['action'] = $
entry['action']
;
+ $trace['action'] = $
this->fixCharset($entry['action'])
;
unset($entry['action']);
$trace['exectime'] = @$entry[$timef];
$this->totaltime += $trace['exectime'];
unset($entry[$timef]);
$trace['rows'] = @$entry[$sizef];
unset($entry[$sizef]);
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;
}
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())
{
$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)
{
$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())
}
public function stop($rows = 0, $error = null, array $userdata = array())
@@
-76,9
+84,9
@@
class PlBacktrace
return;
}
$trace =& $this->traces[count($this->traces) - 1];
return;
}
$trace =& $this->traces[count($this->traces) - 1];
- $trace['time'] = $time - $trace['starttime'];
+ $trace['
exec
time'] = $time - $trace['starttime'];
unset($trace['starttime']);
unset($trace['starttime']);
- $this->totaltime += $trace['time'];
+ $this->totaltime += $trace['
exec
time'];
$this->update($rows, $error, $userdata);
}
$this->update($rows, $error, $userdata);
}
@@
-86,7
+94,8
@@
class PlBacktrace
{
$trace =& $this->traces[count($this->traces) - 1];
$trace['rows'] = $rows;
{
$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;
$trace['data'] = $userdata;
if ($trace['error']) {
$this->error = true;