1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 09:19:48 +02:00

* update DibiVariableInterface

* some bugs fixed
This commit is contained in:
David Grudl
2007-11-12 07:33:23 +00:00
parent 89c53395c1
commit 46850aa588
15 changed files with 53 additions and 53 deletions

View File

@@ -132,11 +132,6 @@ class dibi extends NClass
*/
public static $defaultDriver = 'mysql';
/**
* Start time
* @var int
*/
private static $time;
@@ -396,26 +391,15 @@ class dibi extends NClass
/**
* Event notification (events: exception, connected, beforeQuery, afterQuery, begin, commit, rollback)
*
* @param string event name
* @param DibiConnection
* @param string event name
* @param mixed
* @return void
*/
public static function notify($event, DibiConnection $conn = NULL, $arg = NULL)
public static function notify(DibiConnection $connection = NULL, $event, $arg = NULL)
{
if ($event === 'beforeQuery') {
self::$numOfQueries++;
self::$elapsedTime = FALSE;
self::$time = -microtime(TRUE);
self::$sql = $arg;
} elseif ($event === 'afterQuery') {
self::$elapsedTime = self::$time + microtime(TRUE);
self::$totalTime += self::$elapsedTime;
}
foreach (self::$handlers as $handler) {
call_user_func($handler, $event, $conn, $arg);
call_user_func($handler, $connection, $event, $arg);
}
}