summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Loader.php31
1 files changed, 30 insertions, 1 deletions
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
index 99652c0b8..f833cb713 100644
--- a/system/libraries/Loader.php
+++ b/system/libraries/Loader.php
@@ -236,16 +236,45 @@ class CI_Loader {
}
$CI =& get_instance();
+
+ // for backwards compatibility, load dbforge so we can extend dbutils off it
+ // this use is deprecated and strongly discouraged
+ $CI->load->dbforge();
require_once(BASEPATH.'database/DB_utility'.EXT);
require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT);
$class = 'CI_DB_'.$CI->db->dbdriver.'_utility';
- $CI->dbutil = new $class();
+ $CI->dbutil =& new $class();
+
$CI->load->_ci_assign_to_models();
}
// --------------------------------------------------------------------
+
+ /**
+ * Load the Database Forge Class
+ *
+ * @access public
+ * @return string
+ */
+ function dbforge()
+ {
+ if ( ! class_exists('CI_DB'))
+ {
+ $this->database();
+ }
+
+ $CI =& get_instance();
+
+ require_once(BASEPATH.'database/DB_forge'.EXT);
+ require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge'.EXT);
+ $class = 'CI_DB_'.$CI->db->dbdriver.'_forge';
+
+ $CI->dbforge = new $class();
+ }
+
+ // --------------------------------------------------------------------
/**
* Load View