diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index 23c050e..56b4d6f 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -468,10 +468,22 @@
*/
function _ci_init_dbextra($class)
{
- $map = array('dbutil' => 'DB_utility', 'dbexport' => 'DB_export');
- require_once(BASEPATH.'database/'.$map[$class].EXT);
-
- $this->init_class('CI_'.$map[$class], $class);
+ if ( ! $this->_ci_is_loaded('db'))
+ {
+ $this->_init_database();
+ }
+
+ if ($class == 'dbutil')
+ {
+ require_once(BASEPATH.'database/DB_utility'.EXT);
+ require_once(BASEPATH.'database/drivers/'.$this->db->dbdriver.'/'.$this->db->dbdriver.'_utility'.EXT);
+ $this->init_class('CI_DB_'.$this->db->dbdriver.'_utility', 'dbutil');
+ }
+ elseif ($class == 'dbexport')
+ {
+ require_once(BASEPATH.'database/DB_export'.EXT);
+ $this->init_class('CI_DB_export', 'dbexport');
+ }
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index a95764a..f414373 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -18,13 +18,15 @@
show_error('Your PHP installation does not support XML');
}
+if ( ! class_exists('CI_Xmlrpc'))
+{
+ show_error('You must load the Xmlrpc class before loading the Xmlrpcs class in order to create a server.');
+}
// INITIALIZE THE CLASS ---------------------------------------------------
-require_once(BASEPATH.'libraries/Xmlrpc'.EXT);
-
-// The initialization code is at the bottom of this file. It seems to
-// cause an error to have it at the top
+$obj =& get_instance();
+$obj->init_class('CI_Xmlrpcs');
// ------------------------------------------------------------------------
@@ -503,14 +505,4 @@
}
// END XML_RPC_Server class
-
-// INITIALIZE THE CLASS ---------------------------------------------------
-
-$obj =& get_instance();
-$obj->init_class('CI_Xmlrpc');
-$obj->init_class('CI_Xmlrpcs');
-
-// ------------------------------------------------------------------------
-
-
?>
\ No newline at end of file