1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-08 15:16:58 +02:00

DibiProfiler: $tickets is now static, profiler sets dibi static variables

This commit is contained in:
David Grudl
2010-04-04 00:08:14 +02:00
parent 52f8128a2f
commit 57b68131e6
2 changed files with 21 additions and 23 deletions

View File

@@ -314,22 +314,14 @@ class DibiConnection extends DibiObject
}
$ticket = $this->profiler->before($this, $event, $sql);
}
// TODO: move to profiler?
dibi::$numOfQueries++;
dibi::$sql = $sql;
dibi::$elapsedTime = FALSE;
$time = -microtime(TRUE);
dibi::$sql = $sql;
if ($res = $this->driver->query($sql)) { // intentionally =
$res = new DibiResult($res, $this->config);
} else {
$res = $this->driver->getAffectedRows();
}
$time += microtime(TRUE);
dibi::$elapsedTime = $time;
dibi::$totalTime += $time;
if (isset($ticket)) {
$this->profiler->after($ticket, $res);
}