mirror of
https://github.com/dg/dibi.git
synced 2025-08-12 17:14:16 +02:00
- all drivers accepts injected connection resource
- DibiFluent: fixed identifier substitution
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
* - 'username' (or 'user')
|
||||
* - 'password' (or 'pass')
|
||||
* - 'options' - driver specific options array
|
||||
* - 'pdo' - PDO object (optional)
|
||||
* - 'resource' - PDO object (optional)
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
*
|
||||
* @author David Grudl
|
||||
@@ -69,11 +69,11 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
DibiConnection::alias($config, 'username', 'user');
|
||||
DibiConnection::alias($config, 'password', 'pass');
|
||||
DibiConnection::alias($config, 'dsn');
|
||||
DibiConnection::alias($config, 'pdo');
|
||||
DibiConnection::alias($config, 'resource', 'pdo');
|
||||
DibiConnection::alias($config, 'options');
|
||||
|
||||
if ($config['pdo'] instanceof PDO) {
|
||||
$this->connection = $config['pdo'];
|
||||
if ($config['resource'] instanceof PDO) {
|
||||
$this->connection = $config['resource'];
|
||||
|
||||
} else try {
|
||||
$this->connection = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']);
|
||||
|
Reference in New Issue
Block a user