1
0
mirror of https://github.com/dg/dibi.git synced 2025-09-02 18:42:36 +02:00

throwing exception on connect

This commit is contained in:
David Grudl
2006-11-13 06:32:16 +00:00
parent 11b294be44
commit f447a03c96
11 changed files with 78 additions and 92 deletions

View File

@@ -43,10 +43,10 @@ class DibiPostgreDriver extends DibiDriver {
public static function connect($config)
{
if (!extension_loaded('pgsql'))
return new DibiException("PHP extension 'pgsql' is not loaded");
throw new DibiException("PHP extension 'pgsql' is not loaded");
if (empty($config['string']))
return new DibiException("Connection string must be specified");
throw new DibiException("Connection string must be specified");
if (empty($config['type'])) $config['type'] = NULL;
@@ -57,7 +57,7 @@ class DibiPostgreDriver extends DibiDriver {
$conn = @pg_pconnect($config['string'], $config['type']);
if (!is_resource($conn))
return new DibiException("Connecting error", array(
throw new DibiException("Connecting error", array(
'message' => pg_last_error(),
));