mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-17491 oracle connections - fix annoyance when multiple connections
are used and enforce new connections by using oci_new_connect()
This commit is contained in:
parent
446e2634d4
commit
9d3cbeb695
1 changed files with 5 additions and 4 deletions
|
@ -180,19 +180,20 @@ class oci_native_moodle_database extends moodle_database {
|
|||
$pass = addcslashes($this->dbpass, "'\\");
|
||||
|
||||
if (empty($this->dbhost)) {
|
||||
// old style full address
|
||||
// old style full address (TNS)
|
||||
$dbstring = $this->dbname;
|
||||
} else {
|
||||
if (empty($this->dboptions['dbport'])) {
|
||||
$this->dboptions['dbport'] = 1521;
|
||||
}
|
||||
$this->dbname = '//'.$this->dbhost.':'.$this->dboptions['dbport'].'/'.$this->dbname;
|
||||
$dbstring = '//'.$this->dbhost.':'.$this->dboptions['dbport'].'/'.$this->dbname;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
if (empty($this->dboptions['dbpersit'])) {
|
||||
$this->oci = oci_connect($this->dbuser, $this->dbpass, $this->dbname, 'AL32UTF8');
|
||||
$this->oci = oci_new_connect($this->dbuser, $this->dbpass, $dbstring, 'AL32UTF8');
|
||||
} else {
|
||||
$this->oci = oci_pconnect($this->dbuser, $this->dbpass, $this->dbname, 'AL32UTF8');
|
||||
$this->oci = oci_pconnect($this->dbuser, $this->dbpass, $dbstring, 'AL32UTF8');
|
||||
}
|
||||
$dberr = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue