1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-18 03:41:30 +02:00

- all drivers accepts injected connection resource

- DibiFluent: fixed identifier substitution
This commit is contained in:
David Grudl
2009-01-17 19:27:40 +00:00
parent 47d1180aee
commit 5ecfaf7ab1
10 changed files with 108 additions and 71 deletions

View File

@@ -28,6 +28,7 @@
* - 'password' (or 'pass')
* - 'charset' - character encoding to set
* - 'lazy' - if TRUE, connection will be established only when required
* - 'resource' - connection resource (optional)
*
* @author David Grudl
* @copyright Copyright (c) 2005, 2009 David Grudl
@@ -70,7 +71,11 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
DibiConnection::alias($config, 'database', 'db');
DibiConnection::alias($config, 'charset');
$this->connection = @oci_new_connect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @
if (isset($config['resource'])) {
$this->connection = $config['resource'];
} else {
$this->connection = @oci_new_connect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @
}
if (!$this->connection) {
$err = oci_error();