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

- removed NException, ability of catching PHP error moved to DibiDriverException

This commit is contained in:
David Grudl
2008-03-04 14:01:22 +00:00
parent 1459c6c95d
commit 2632953541
8 changed files with 125 additions and 162 deletions

View File

@@ -88,22 +88,26 @@ class DibiPostgreDriver extends NObject implements IDibiDriver
}
}
DibiDriverException::catchError();
DibiDriverException::tryError();
if (isset($config['persistent'])) {
$this->connection = @pg_connect($string, PGSQL_CONNECT_FORCE_NEW);
$this->connection = pg_connect($string, PGSQL_CONNECT_FORCE_NEW);
} else {
$this->connection = @pg_pconnect($string, PGSQL_CONNECT_FORCE_NEW);
$this->connection = pg_pconnect($string, PGSQL_CONNECT_FORCE_NEW);
}
if (DibiDriverException::catchError($msg)) {
throw new DibiDriverException($msg, 0);
}
DibiDriverException::restore();
if (!is_resource($this->connection)) {
throw new DibiDriverException('Connecting error.');
}
if (isset($config['charset'])) {
DibiDriverException::catchError();
@pg_set_client_encoding($this->connection, $config['charset']);
DibiDriverException::restore();
DibiDriverException::tryError();
pg_set_client_encoding($this->connection, $config['charset']);
if (DibiDriverException::catchError($msg)) {
throw new DibiDriverException($msg, 0);
}
}
if (isset($config['schema'])) {