diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-01-16 22:10:09 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-01-16 22:10:09 +0100 |
commit | 39b622db9bda38282a32bb45623da63efe685729 (patch) | |
tree | 0d1a1729dc544ebfd1d3dfb11b2ff78759bcf7be /system/libraries | |
parent | f4615fec22671262e95d3a852f8b9088314118f2 (diff) |
Many new Active Record functions, and another whack of stuff
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Loader.php | 31 |
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
|