Permalink
Browse files

MDL-36807 use our mysql socket logic in adodb tests

  • Loading branch information...
1 parent 322af44 commit a48b37697861b245aab03577ca19eb78e710ab54 @skodak skodak committed Nov 23, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 enrol/database/tests/sync_test.php
@@ -58,7 +58,11 @@ protected function init_enrol_database() {
set_config('dbsetupsql', "SET NAMES 'UTF-8'", 'enrol_database');
set_config('dbsybasequoting', '0', 'enrol_database');
if (!empty($CFG->dboptions['dbsocket'])) {
- set_config('dbtype', 'mysqli://'.rawurlencode($CFG->dbuser).':'.rawurlencode($CFG->dbpass).'@'.rawurlencode($CFG->dbhost).'/'.rawurlencode($CFG->dbname).'?socket='.rawurlencode($CFG->dboptions['dbsocket']), 'enrol_database');
+ $dbsocket = $CFG->dboptions['dbsocket'];
+ if ((strpos($dbsocket, '/') === false and strpos($dbsocket, '\\') === false)) {
+ $dbsocket = ini_get('mysqli.default_socket');
+ }
+ set_config('dbtype', 'mysqli://'.rawurlencode($CFG->dbuser).':'.rawurlencode($CFG->dbpass).'@'.rawurlencode($CFG->dbhost).'/'.rawurlencode($CFG->dbname).'?socket='.rawurlencode($dbsocket), 'enrol_database');
}
break;

0 comments on commit a48b376

Please sign in to comment.