mirror of
https://github.com/dg/dibi.git
synced 2025-08-12 17:14:16 +02:00
* better syntax highlighting
* all drivers checks for extension in constructor * DibiMySqlDriver - charset is set by mysql_set_charset * DibiMySqliDriver - charset is set by mysqli_set_charset
This commit is contained in:
@@ -58,6 +58,18 @@ class DibiPdoDriver extends NObject implements DibiDriverInterface
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('pdo')) {
|
||||
throw new DibiDriverException("PHP extension 'pdo' is not loaded");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Connects to a database
|
||||
*
|
||||
@@ -71,10 +83,6 @@ class DibiPdoDriver extends NObject implements DibiDriverInterface
|
||||
DibiConnection::alias($config, 'dsn');
|
||||
DibiConnection::alias($config, 'options');
|
||||
|
||||
if (!extension_loaded('pdo')) {
|
||||
throw new DibiException("PHP extension 'pdo' is not loaded");
|
||||
}
|
||||
|
||||
try {
|
||||
$this->connection = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']);
|
||||
} catch (PDOException $e) {
|
||||
|
Reference in New Issue
Block a user