mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
MDL-17374 DML: improved BC in pg driver
This commit is contained in:
parent
e86ecf1f04
commit
e6b854a01c
1 changed files with 8 additions and 5 deletions
|
@ -97,15 +97,18 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||||
$pass = addcslashes($this->dbpass, "'\\");
|
$pass = addcslashes($this->dbpass, "'\\");
|
||||||
|
|
||||||
// Unix socket connections should have lower overhead
|
// Unix socket connections should have lower overhead
|
||||||
if (empty($this->dboptions['forcetcp']) and ($this->dbhost === 'localhost' or $this->dbhost === '127.0.0.1')) {
|
if (!empty($this->dboptions['dbsocket']) and ($this->dbhost === 'localhost' or $this->dbhost === '127.0.0.1')) {
|
||||||
$connection = "user='$this->dbuser' password='$pass' dbname='$this->dbname'";
|
$connection = "user='$this->dbuser' password='$pass' dbname='$this->dbname'";
|
||||||
} else {
|
} else {
|
||||||
if (empty($this->dboptions['dbport'])) {
|
if (empty($this->dbname)) {
|
||||||
$port = 5432;
|
// probably old style socket connection - do not add port
|
||||||
|
$port = "";
|
||||||
|
} else if (empty($this->dboptions['dbport'])) {
|
||||||
|
$port = "port ='5432'";
|
||||||
} else {
|
} else {
|
||||||
$port = $this->dboptions['dbport'];
|
$port = "port ='".$this->dboptions['dbport']."'";
|
||||||
}
|
}
|
||||||
$connection = "host='$this->dbhost' port='$port' user='$this->dbuser' password='$pass' dbname='$this->dbname'";
|
$connection = "host='$this->dbhost' $port user='$this->dbuser' password='$pass' dbname='$this->dbname'";
|
||||||
}
|
}
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue