Skip to content

Commit

Permalink
Refactored DB Forge
Browse files Browse the repository at this point in the history
- 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 bcit-ci#1005.
  • Loading branch information
narfbg committed Nov 5, 2012
1 parent 2b73037 commit a287a34
Show file tree
Hide file tree
Showing 31 changed files with 3,487 additions and 1,387 deletions.
15 changes: 14 additions & 1 deletion system/core/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,20 @@ public function dbforge()

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();
}
Expand Down
Loading

0 comments on commit a287a34

Please sign in to comment.