diff options
Diffstat (limited to 'system/database/DB.php')
-rw-r--r-- | system/database/DB.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/system/database/DB.php b/system/database/DB.php index 032cf1b76..d751325ce 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -170,6 +170,19 @@ function &DB($params = '', $query_builder_override = NULL) $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; $DB = new $driver($params); + // Check for a subdriver + if ( ! empty($DB->subdriver)) + { + $driver_file = BASEPATH.'database/drivers/'.$DB->dbdriver.'/subdrivers/'.$DB->dbdriver.'_'.$DB->subdriver.'_driver.php'; + + if (file_exists($driver_file)) + { + require_once($driver_file); + $driver = 'CI_DB_'.$DB->dbdriver.'_'.$DB->subdriver.'_driver'; + $DB = new $driver($params); + } + } + if ($DB->autoinit === TRUE) { $DB->initialize(); |