1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-08 23:26:49 +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

@@ -44,10 +44,10 @@ class DibiSqliteDriver extends DibiDriver {
public static function connect($config)
{
if (!extension_loaded('sqlite'))
return new DibiException("PHP extension 'sqlite' is not loaded");
throw new DibiException("PHP extension 'sqlite' is not loaded");
if (empty($config['database']))
return new DibiException("Database must be specified");
throw new DibiException("Database must be specified");
if (!isset($config['mode']))
$config['mode'] = 0666;
@@ -59,7 +59,7 @@ class DibiSqliteDriver extends DibiDriver {
$conn = @sqlite_popen($config['database'], $config['mode'], $errorMsg);
if (!$conn)
return new DibiException("Connecting error", array(
throw new DibiException("Connecting error", array(
'message' => $errorMsg,
));
@@ -136,7 +136,7 @@ class DibiSqliteDriver extends DibiDriver {
public function quoteName($value)
{
return $value;
return '[' . $value . ']';
}