Commit 0ea12d44 authored by Steve Müller's avatar Steve Müller Committed by Benjamin Eberlei

add pdo_oracle driver connection pool option

parent 6d4e5d4a
...@@ -53,10 +53,11 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -53,10 +53,11 @@ class Driver implements \Doctrine\DBAL\Driver
*/ */
private function _constructPdoDsn(array $params) private function _constructPdoDsn(array $params)
{ {
$dsn = 'oci:'; $dsn = 'oci:dbname=';
if (isset($params['host']) && $params['host'] != '') { if (isset($params['host']) && $params['host'] != '') {
$dsn .= 'dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' . $dsn .= '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' .
'(HOST=' . $params['host'] . ')'; '(HOST=' . $params['host'] . ')';
if (isset($params['port'])) { if (isset($params['port'])) {
$dsn .= '(PORT=' . $params['port'] . ')'; $dsn .= '(PORT=' . $params['port'] . ')';
...@@ -64,13 +65,20 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -64,13 +65,20 @@ class Driver implements \Doctrine\DBAL\Driver
$dsn .= '(PORT=1521)'; $dsn .= '(PORT=1521)';
} }
$database = 'SID=' . $params['dbname'];
$pooled = '';
if (isset($params['service']) && $params['service'] == true) { if (isset($params['service']) && $params['service'] == true) {
$dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))'; $database = 'SERVICE_NAME=' . $params['dbname'];
} else {
$dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))';
} }
if (isset($params['pooled']) && $params['pooled'] == true) {
$pooled = '(SERVER=POOLED)';
}
$dsn .= '))(CONNECT_DATA=(' . $database . ')' . $pooled . '))';
} else { } else {
$dsn .= 'dbname=' . $params['dbname']; $dsn .= $params['dbname'];
} }
if (isset($params['charset'])) { if (isset($params['charset'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment