Commit c4786f5a authored by Nigel McNie's avatar Nigel McNie
Browse files

Set the dbtype early in init.php instead of in ddl.php.

This ensures the db type is set correctly for adodb when it goes looking
for a driver. It used to work fine, until we stopped including ddl on
every page.
parent 6c868aa6
......@@ -91,6 +91,13 @@ try {
// the error is instead.
ob_start();
if (is_postgres()) {
$CFG->dbtype = 'postgres7';
}
else if (is_mysql()) {
$CFG->dbtype = 'mysql';
}
$db = &ADONewConnection($CFG->dbtype);
if (empty($CFG->dbhost)) {
$CFG->dbhost = '';
......
......@@ -46,12 +46,6 @@
global $CFG;
$CFG->libdir = get_config('libroot');
$CFG->prefix = (isset($CFG->dbprefix)) ? $CFG->dbprefix : '';
if (is_postgres()) {
$CFG->dbtype = 'postgres7';
}
else if (is_mysql()) {
$CFG->dbtype = 'mysql';
}
// Mahara hacks end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment