Skip to content

Commit

Permalink
Add warning on pdo_oracle usage and implemented DBAL-141
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Oct 30, 2011
1 parent 08e6c48 commit 5be1613
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/Doctrine/DBAL/Driver/OCI8/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/**
* A Doctrine DBAL driver for the Oracle OCI8 PHP extensions.
*
*
* @author Roman Borschel <[email protected]>
* @since 2.0
*/
Expand Down Expand Up @@ -60,11 +60,11 @@ protected function _constructDsn(array $params)
$dsn .= '(PORT=1521)';
}

$dsn .= '))';
if (isset($params['dbname'])) {
$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'] . ')))';
}
$dsn .= '))';
} else {
$dsn .= $params['dbname'];
}
Expand Down
16 changes: 13 additions & 3 deletions lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand All @@ -23,6 +21,14 @@

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
{
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
Expand Down Expand Up @@ -53,7 +59,11 @@ private function _constructPdoDsn(array $params)
$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 {
$dsn .= 'dbname=' . $params['dbname'];
}
Expand Down

0 comments on commit 5be1613

Please sign in to comment.