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:
@@ -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 . ']';
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user