Now set_dbfamily() will work properly when invoked from install.

This commit is contained in:
stronk7 2007-01-12 23:52:23 +00:00
parent c672870f8e
commit d847d4027b

View File

@ -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';