Commit 5be16133 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Add warning on pdo_oracle usage and implemented DBAL-141

parent 08e6c483
...@@ -60,11 +60,11 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -60,11 +60,11 @@ class Driver implements \Doctrine\DBAL\Driver
$dsn .= '(PORT=1521)'; $dsn .= '(PORT=1521)';
} }
$dsn .= '))'; if (isset($params['service']) && $params['service'] == true) {
if (isset($params['dbname'])) { $dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))';
$dsn .= '(CONNECT_DATA=(SID=' . $params['dbname'] . ')'; } else {
$dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))';
} }
$dsn .= '))';
} else { } else {
$dsn .= $params['dbname']; $dsn .= $params['dbname'];
} }
......
<?php <?php
/* /*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...@@ -23,6 +21,14 @@ namespace Doctrine\DBAL\Driver\PDOOracle; ...@@ -23,6 +21,14 @@ namespace Doctrine\DBAL\Driver\PDOOracle;
use Doctrine\DBAL\Platforms; use Doctrine\DBAL\Platforms;
/**
* PDO Oracle driver
*
* WARNING: This driver gives us segfauls in our testsuites on CLOB and other
* stuff. PDO Oracle is not maintained by Oracle or anyone in the PHP community,
* which leads us to the recommendation to use the "oci8" driver to connect
* to Oracle instead.
*/
class Driver implements \Doctrine\DBAL\Driver class Driver implements \Doctrine\DBAL\Driver
{ {
public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
...@@ -53,7 +59,11 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -53,7 +59,11 @@ class Driver implements \Doctrine\DBAL\Driver
$dsn .= '(PORT=1521)'; $dsn .= '(PORT=1521)';
} }
if (isset($params['service']) && $params['service'] == true) {
$dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))';
} else {
$dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))'; $dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))';
}
} else { } else {
$dsn .= 'dbname=' . $params['dbname']; $dsn .= 'dbname=' . $params['dbname'];
} }
......
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