mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-44862 always add dbport to dbsocket in pg driver
This should hopefully resolve problems when using sockets connection to pg servers running on non-standard ports.
This commit is contained in:
parent
ad32dda90c
commit
96255f472c
@ -136,6 +136,10 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
$connection = "user='$this->dbuser' password='$pass' dbname='$this->dbname'";
|
||||
if (strpos($this->dboptions['dbsocket'], '/') !== false) {
|
||||
$connection = $connection." host='".$this->dboptions['dbsocket']."'";
|
||||
if (!empty($this->dboptions['dbport'])) {
|
||||
// Somehow non-standard port is important for sockets - see MDL-44862.
|
||||
$connection = $connection." port ='".$this->dboptions['dbport']."'";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->dboptions['dbsocket'] = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user