1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-19 12:21:46 +02:00

* DibiConnection::getConfig('name') returns name of connection

* seek() returns boolean again
* DibiDriver throws exception when is used after free()
This commit is contained in:
David Grudl
2007-11-13 01:51:44 +00:00
parent 40444c1341
commit 0eeff53fe8
14 changed files with 85 additions and 56 deletions

View File

@@ -104,9 +104,11 @@ class DibiConnection extends NObject
*/
final protected function connect()
{
$this->driver->connect($this->config);
$this->connected = TRUE;
dibi::notify($this, 'connected');
if (!$this->connected) {
$this->driver->connect($this->config);
$this->connected = TRUE;
dibi::notify($this, 'connected');
}
}
@@ -232,7 +234,7 @@ class DibiConnection extends NObject
*/
final public function nativeQuery($sql)
{
if (!$this->connected) $this->connect();
$this->connect();
dibi::$numOfQueries++;
dibi::$sql = $sql;
@@ -285,7 +287,7 @@ class DibiConnection extends NObject
*/
public function begin()
{
if (!$this->connected) $this->connect();
$this->connect();
$this->driver->begin();
dibi::notify($this, 'begin');
}
@@ -298,7 +300,7 @@ class DibiConnection extends NObject
*/
public function commit()
{
if (!$this->connected) $this->connect();
$this->connect();
$this->driver->commit();
dibi::notify($this, 'commit');
}
@@ -311,7 +313,7 @@ class DibiConnection extends NObject
*/
public function rollback()
{
if (!$this->connected) $this->connect();
$this->connect();
$this->driver->rollback();
dibi::notify($this, 'rollback');
}