summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-09-27 02:31:22 +0200
committeradmin <devnull@localhost>2006-09-27 02:31:22 +0200
commite5bb936f808bfd39a6ba8cbe1fc2ddbcf9bf502f (patch)
tree20dd6d9775c9c2a4e097278f3cf659c42e8507f5 /system
parente1770339a3c89d53b99529ae6a639e5c3dd0fd66 (diff)
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_utility.php5
-rw-r--r--system/database/drivers/mysql/mysql_utility.php2
-rw-r--r--system/libraries/Controller.php20
-rw-r--r--system/libraries/Xmlrpcs.php20
4 files changed, 26 insertions, 21 deletions
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 281a3b87d..a2469d059 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -191,8 +191,7 @@ class CI_DB_utility {
* Optimize Database
*
* @access public
- * @param string the table name
- * @return bool
+ * @return array
*/
function optimize_database()
{
@@ -207,6 +206,8 @@ class CI_DB_utility {
}
$query = $this->db->query($sql);
+
+ // Build the result array...
$res = current($query->result_array());
$key = str_replace($this->db->database.'.', '', current($res));
$keys = array_keys($res);
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index 9ba4a79c5..a81936c56 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -12,7 +12,7 @@
* @since Version 1.0
* @filesource
*/
-
+
// ------------------------------------------------------------------------
/**
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index 23c050e18..56b4d6f90 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -468,10 +468,22 @@ class Controller extends CI_Base {
*/
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 a95764a98..f41437342 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -18,13 +18,15 @@ if ( ! function_exists('xml_parser_create'))
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 @@ class CI_Xmlrpcs extends CI_Xmlrpc
}
// 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