diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-11-05 22:19:59 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-11-05 22:19:59 +0100 |
commit | a287a34c215903d3452023d74149eb5880125715 (patch) | |
tree | 92af334c0797e8c3112ce5d05cb6be741dda658c /system/core/Loader.php | |
parent | 2b73037e450859e85fb468ad7499a26882a67292 (diff) |
Refactored DB Forge
- PDO subdrivers are isolated from each other now.
- Added compatibility for pretty much all of the features, for every DB platform.
- Unified the way that stuff works in general.
- Fixes issue #1005.
Diffstat (limited to 'system/core/Loader.php')
-rw-r--r-- | system/core/Loader.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php index 88fbdb6e1..808fa80df 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -392,7 +392,20 @@ class CI_Loader { require_once(BASEPATH.'database/DB_forge.php'); require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge.php'); - $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; + + if ( ! empty($CI->db->subdriver)) + { + $driver_path = BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/subdrivers/'.$CI->db->dbdriver.'_'.$CI->db->subdriver.'_forge.php'; + if (file_exists($driver_path)) + { + require_once($driver_path); + $class = 'CI_DB_'.$CI->db->dbdriver.'_'.$CI->db->subdriver.'_forge'; + } + } + else + { + $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; + } $CI->dbforge = new $class(); } |