Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'w51_MDL-36807_m24_mysocket' of git://github.com/skodak/…

…moodle into MOODLE_24_STABLE
  • Loading branch information...
commit f849d1f6fc557cfc5328adb8d77cb2873cd0a325 2 parents f4537d5 + a48b376
@stronk7 stronk7 authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 enrol/database/tests/sync_test.php
View
6 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;
Please sign in to comment.
Something went wrong with that request. Please try again.