MDL-34309: Fix broken postgres unix sockets in core_adodb_testcase::test_read_table

This commit is contained in:
Ashley Holman 2012-07-12 23:18:51 +09:30 committed by Sam Hemelryk
parent 11f8318ccc
commit 081ebacfe9

View File

@ -70,7 +70,11 @@ class core_adodb_testcase extends advanced_testcase {
set_config('dbsetupsql', 'SET NAMES \'UTF-8\'', 'enrol_database');
set_config('dbsybasequoting', '0', 'enrol_database');
if (!empty($CFG->dboptions['dbsocket']) and ($CFG->dbhost === 'localhost' or $CFG->dbhost === '127.0.0.1')) {
set_config('dbhost', $CFG->dboptions['dbsocket'], 'enrol_database');
if (strpos($CFG->dboptions['dbsocket'], '/') !== false) {
set_config('dbhost', $CFG->dboptions['dbsocket'], 'enrol_database');
} else {
set_config('dbhost', '', 'enrol_database');
}
}
break;