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

optimizations

This commit is contained in:
David Grudl
2007-11-23 23:50:57 +00:00
parent 7c6947a019
commit c8fedf7692
5 changed files with 4 additions and 56 deletions

View File

@@ -320,18 +320,6 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
/**
* Converts database error to DibiDriverException
*
* @throws DibiDriverException
*/
protected function throwException($sql=NULL)
{
throw new DibiDriverException();
}
/**
* Returns the connection resource
*

View File

@@ -117,7 +117,7 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface
$this->resultset = @pg_query($this->connection, $sql);
if ($this->resultset === FALSE) {
$this->throwException($sql);
throw new DibiDriverException(pg_last_error($this->connection), 0, $sql);
}
return is_resource($this->resultset);
@@ -326,18 +326,6 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface
/**
* Converts database error to DibiDriverException
*
* @throws DibiDriverException
*/
protected function throwException($sql=NULL)
{
throw new DibiDriverException(pg_last_error($this->connection), 0, $sql);
}
/**
* Returns the connection resource
*

View File

@@ -120,16 +120,12 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface
DibiDriverException::catchError();
if ($this->buffered) {
$this->resultset = sqlite_query($this->connection, $sql, SQLITE_ASSOC);
$this->resultset = sqlite_query($this->connection, $sql);
} else {
$this->resultset = sqlite_unbuffered_query($this->connection, $sql, SQLITE_ASSOC);
$this->resultset = sqlite_unbuffered_query($this->connection, $sql);
}
DibiDriverException::restore();
if (sqlite_last_error($this->connection)) {
$this->throwException();
}
return is_resource($this->resultset);
}
@@ -303,19 +299,6 @@ class DibiSqliteDriver extends NObject implements DibiDriverInterface
/**
* Converts database error to DibiDriverException
*
* @throws DibiDriverException
*/
protected function throwException($sql=NULL)
{
$errno = sqlite_last_error($this->connection);
throw new DibiDriverException(sqlite_error_string($errno), $errno, $sql);
}
/**
* Returns the connection resource
*