Skip to content

Commit

Permalink
Merge branch 'MDL-47666_27' of git://github.com/timhunt/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_27_STABLE
  • Loading branch information
danpoltawski committed Oct 20, 2014
2 parents 813e70a + 9812ea0 commit 2c1a9dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
23 changes: 11 additions & 12 deletions auth/db/tests/db_test.php
Expand Up @@ -52,14 +52,9 @@ public function init_auth_database() {
set_config('host', $CFG->dbhost.':'.$CFG->dboptions['dbport'], 'auth/db');
}

switch (get_class($DB)) {
case 'mssql_native_moodle_database':
set_config('type', 'mssql_n', 'auth/db');
set_config('sybasequoting', '1', 'auth/db');
break;
switch ($DB->get_dbfamily()) {

case 'mariadb_native_moodle_database':
case 'mysqli_native_moodle_database':
case 'mysql':
set_config('type', 'mysqli', 'auth/db');
set_config('setupsql', "SET NAMES 'UTF-8'", 'auth/db');
set_config('sybasequoting', '0', 'auth/db');
Expand All @@ -72,12 +67,12 @@ public function init_auth_database() {
}
break;

case 'oci_native_moodle_database':
case 'oracle':
set_config('type', 'oci8po', 'auth/db');
set_config('sybasequoting', '1', 'auth/db');
break;

case 'pgsql_native_moodle_database':
case 'postgres':
set_config('type', 'postgres7', 'auth/db');
$setupsql = "SET NAMES 'UTF-8'";
if (!empty($CFG->dboptions['dbschema'])) {
Expand All @@ -98,13 +93,17 @@ public function init_auth_database() {
}
break;

case 'sqlsrv_native_moodle_database':
set_config('type', 'mssqlnative', 'auth/db');
case 'mssql':
if (get_class($DB) == 'mssql_native_moodle_database') {
set_config('type', 'mssql_n', 'auth/db');
} else {
set_config('type', 'mssqlnative', 'auth/db');
}
set_config('sybasequoting', '1', 'auth/db');
break;

default:
throw new exception('Unknown database driver '.get_class($DB));
throw new exception('Unknown database family ' . $DB->get_dbfamily());
}

$table = new xmldb_table('auth_db_users');
Expand Down
21 changes: 10 additions & 11 deletions enrol/database/tests/sync_test.php
Expand Up @@ -54,14 +54,9 @@ protected function init_enrol_database() {
set_config('dbhost', $CFG->dbhost.':'.$CFG->dboptions['dbport'], 'enrol_database');
}

switch (get_class($DB)) {
case 'mssql_native_moodle_database':
set_config('dbtype', 'mssql_n', 'enrol_database');
set_config('dbsybasequoting', '1', 'enrol_database');
break;
switch ($DB->get_dbfamily()) {

case 'mariadb_native_moodle_database':
case 'mysqli_native_moodle_database':
case 'mysql':
set_config('dbtype', 'mysqli', 'enrol_database');
set_config('dbsetupsql', "SET NAMES 'UTF-8'", 'enrol_database');
set_config('dbsybasequoting', '0', 'enrol_database');
Expand All @@ -74,12 +69,12 @@ protected function init_enrol_database() {
}
break;

case 'oci_native_moodle_database':
case 'oracle':
set_config('dbtype', 'oci8po', 'enrol_database');
set_config('dbsybasequoting', '1', 'enrol_database');
break;

case 'pgsql_native_moodle_database':
case 'postgres':
set_config('dbtype', 'postgres7', 'enrol_database');
$setupsql = "SET NAMES 'UTF-8'";
if (!empty($CFG->dboptions['dbschema'])) {
Expand All @@ -100,8 +95,12 @@ protected function init_enrol_database() {
}
break;

case 'sqlsrv_native_moodle_database':
set_config('dbtype', 'mssqlnative', 'enrol_database');
case 'mssql':
if (get_class($DB) == 'mssql_native_moodle_database') {
set_config('dbtype', 'mssql_n', 'enrol_database');
} else {
set_config('dbtype', 'mssqlnative', 'enrol_database');
}
set_config('dbsybasequoting', '1', 'enrol_database');
break;

Expand Down

0 comments on commit 2c1a9dc

Please sign in to comment.