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

Add warning on pdo_oracle usage and implemented DBAL-141

parent 08e6c483
...@@ -25,7 +25,7 @@ use Doctrine\DBAL\Platforms; ...@@ -25,7 +25,7 @@ use Doctrine\DBAL\Platforms;
/** /**
* A Doctrine DBAL driver for the Oracle OCI8 PHP extensions. * A Doctrine DBAL driver for the Oracle OCI8 PHP extensions.
* *
* @author Roman Borschel <roman@code-factory.org> * @author Roman Borschel <roman@code-factory.org>
* @since 2.0 * @since 2.0
*/ */
...@@ -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)';
} }
$dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))'; if (isset($params['service']) && $params['service'] == true) {
$dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))';
} else {
$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