1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 13:47:33 +02:00

Allow forcing a persistent connection via driver configuration

This commit is contained in:
Jirka Chadima
2012-08-28 11:05:40 +02:00
committed by David Grudl
parent dfda0b4d96
commit f355b8ede7

View File

@@ -21,6 +21,7 @@
* - formatDate => how to format date in SQL (@see date) * - formatDate => how to format date in SQL (@see date)
* - formatDateTime => how to format datetime in SQL (@see date) * - formatDateTime => how to format datetime in SQL (@see date)
* - resource (resource) => existing connection resource * - resource (resource) => existing connection resource
* - persistent => Creates persistent connections with oci_pconnect instead of oci_new_connect
* - lazy, profiler, result, substitutes, ... => see DibiConnection options * - lazy, profiler, result, substitutes, ... => see DibiConnection options
* *
* @author David Grudl * @author David Grudl
@@ -70,8 +71,10 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
if (isset($config['resource'])) { if (isset($config['resource'])) {
$this->connection = $config['resource']; $this->connection = $config['resource'];
} else { } elseif (empty($config['persistent'])) {
$this->connection = @oci_new_connect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @ $this->connection = @oci_new_connect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @
} else {
$this->connection = @oci_pconnect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @
} }
if (!$this->connection) { if (!$this->connection) {