From d847d4027bf4fb1ac04a06d14f94781fb3633129 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 12 Jan 2007 23:52:23 +0000 Subject: [PATCH] Now set_dbfamily() will work properly when invoked from install. --- lib/dmllib.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index d3f73483ce..fb8bf2e64c 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1832,9 +1832,17 @@ function configure_dbconnection() { */ function set_dbfamily() { - global $CFG; + global $CFG, $INSTALL; - switch ($CFG->dbtype) { + // Since this function is also used during installation process, i.e. during install.php before $CFG->dbtype is set. + // we need to get dbtype from the right variable + if (!empty($INSTALL['dbtype'])) { + $dbtype = $INSTALL['dbtype']; + } else { + $dbtype = $CFG->dbtype; + } + + switch ($dbtype) { case 'mysql': case 'mysqli': $CFG->dbfamily='mysql'; -- 2.39.5