Commit b1347806 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Patch by milokment to fix charset configuration and allow to change oci session mode.

parent a3becb14
......@@ -36,7 +36,9 @@ class Driver implements \Doctrine\DBAL\Driver
return new OCI8Connection(
$username,
$password,
$this->_constructDsn($params)
$this->_constructDsn($params),
isset($params['charset']) ? $params['charset'] : null,
isset($params['sessionMode']) ? $params['sessionMode'] : OCI_DEFAULT
);
}
......@@ -67,10 +69,6 @@ class Driver implements \Doctrine\DBAL\Driver
$dsn .= $params['dbname'];
}
if (isset($params['charset'])) {
$dsn .= ';charset=' . $params['charset'];
}
return $dsn;
}
......
......@@ -37,13 +37,13 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
* @param string $password
* @param string $db
*/
public function __construct($username, $password, $db)
public function __construct($username, $password, $db, $charset = null, $sessionMode = OCI_DEFAULT)
{
if (!defined('OCI_NO_AUTO_COMMIT')) {
define('OCI_NO_AUTO_COMMIT', 0);
}
$this->_dbh = @oci_connect($username, $password, $db);
$this->_dbh = @oci_connect($username, $password, $db, $charset, $sessionMode);
if (!$this->_dbh) {
throw OCI8Exception::fromErrorInfo(oci_error());
}
......
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