mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
DibiPdoDriver: missing driver throws DibiNotSupportedException exception
This commit is contained in:
@@ -68,11 +68,10 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
|
|||||||
$this->connection = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']);
|
$this->connection = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']);
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
throw new DibiDriverException($e->getMessage(), $e->getCode());
|
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);
|
$this->driverName = $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME);
|
||||||
|
Reference in New Issue
Block a user