Skip to content
Browse files

MDL-34309: Fix broken postgres unix sockets in core_adodb_testcase::t…

…est_read_table
  • Loading branch information...
1 parent e7bf015 commit bf79f77357f70cbe0356e08631744ec8764abfc0 @ashleyholman ashleyholman committed with Sam Hemelryk Jul 12, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 enrol/database/tests/adodb_test.php
View
6 enrol/database/tests/adodb_test.php
@@ -70,7 +70,11 @@ public function test_read_table() {
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;

0 comments on commit bf79f77

Please sign in to comment.
Something went wrong with that request. Please try again.