mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
DibiPdoDriver: missing driver throws DibiNotSupportedException exception
This commit is contained in:
@@ -68,13 +68,12 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
|
||||
$this->connection = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
if ($e->getMessage() === 'could not find driver') {
|
||||
throw new DibiNotSupportedException("PHP extension for PDO is not loaded.");
|
||||
}
|
||||
throw new DibiDriverException($e->getMessage(), $e->getCode());
|
||||
}
|
||||
|
||||
if (!$this->connection) {
|
||||
throw new DibiDriverException('Connecting error.');
|
||||
}
|
||||
|
||||
$this->driverName = $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user