$real_db = clone($DB);
$real_cfg = clone($CFG);
$CFG = new stdClass();
-$CFG->dbhost = $real_cfg->dbhost;
-$CFG->dbtype = $real_cfg->dbtype;
-$CFG->dblibrary = $real_cfg->dblibrary;
-$CFG->dbuser = $real_cfg->dbuser;
-$CFG->dbpass = $real_cfg->dbpass;
-$CFG->dbname = $real_cfg->dbname;
-$CFG->dbpersist = $real_cfg->dbpersist;
-$CFG->unittest_prefix = $real_cfg->unittest_prefix;
-$CFG->wwwroot = $real_cfg->wwwroot;
-$CFG->dirroot = $real_cfg->dirroot;
-$CFG->libdir = $real_cfg->libdir;
-$CFG->dataroot = $real_cfg->dataroot;
-$CFG->admin = $real_cfg->admin;
-$CFG->release = $real_cfg->release;
-$CFG->config_php_settings = $real_cfg->config_php_settings;
-$CFG->frametarget = $real_cfg->frametarget;
-$CFG->footer = $real_cfg->footer;
+$CFG->dbhost = $real_cfg->dbhost;
+$CFG->dbtype = $real_cfg->dbtype;
+$CFG->dblibrary = $real_cfg->dblibrary;
+$CFG->dbuser = $real_cfg->dbuser;
+$CFG->dbpass = $real_cfg->dbpass;
+$CFG->dbname = $real_cfg->dbname;
+$CFG->dbpersist = $real_cfg->dbpersist;
+$CFG->unittest_prefix = $real_cfg->unittest_prefix;
+$CFG->wwwroot = $real_cfg->wwwroot;
+$CFG->dirroot = $real_cfg->dirroot;
+$CFG->libdir = $real_cfg->libdir;
+$CFG->dataroot = $real_cfg->dataroot;
+$CFG->admin = $real_cfg->admin;
+$CFG->release = $real_cfg->release;
+$CFG->config_php_settings = $real_cfg->config_php_settings;
+$CFG->frametarget = $real_cfg->frametarget;
+$CFG->framename = $real_cfg->framename;
+$CFG->footer = $real_cfg->footer;
+$CFG->debug = $real_cfg->debug;
$DB = moodle_database::get_driver_instance($CFG->dbtype, $CFG->dblibrary);
$DB->connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->dbpersist, $CFG->unittest_prefix);