Permalink
Browse files

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.
  • Loading branch information...
1 parent 2b73037 commit a287a34c215903d3452023d74149eb5880125715 @narfbg narfbg committed Nov 5, 2012
Showing with 3,487 additions and 1,387 deletions.
  1. +14 −1 system/core/Loader.php
  2. +568 −63 system/database/DB_forge.php
  3. +78 −136 system/database/drivers/cubrid/cubrid_forge.php
  4. +122 −82 system/database/drivers/ibase/ibase_forge.php
  5. +64 −96 system/database/drivers/mssql/mssql_forge.php
  6. +91 −116 system/database/drivers/mysql/mysql_forge.php
  7. +91 −116 system/database/drivers/mysqli/mysqli_forge.php
  8. +43 −88 system/database/drivers/oci8/oci8_forge.php
  9. +17 −109 system/database/drivers/odbc/odbc_forge.php
  10. +5 −126 system/database/drivers/pdo/pdo_forge.php
  11. +209 −0 system/database/drivers/pdo/subdrivers/pdo_4d_forge.php
  12. +173 −0 system/database/drivers/pdo/subdrivers/pdo_cubrid_forge.php
  13. +136 −0 system/database/drivers/pdo/subdrivers/pdo_dblib_forge.php
  14. +228 −0 system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php
  15. +146 −0 system/database/drivers/pdo/subdrivers/pdo_ibm_forge.php
  16. +155 −0 system/database/drivers/pdo/subdrivers/pdo_informix_forge.php
  17. +198 −0 system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php
  18. +133 −0 system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
  19. +62 −0 system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php
  20. +193 −0 system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
  21. +228 −0 system/database/drivers/pdo/subdrivers/pdo_sqlite_forge.php
  22. +136 −0 system/database/drivers/pdo/subdrivers/pdo_sqlsrv_forge.php
  23. +103 −142 system/database/drivers/postgre/postgre_forge.php
  24. +92 −100 system/database/drivers/sqlite/sqlite_forge.php
  25. +102 −99 system/database/drivers/sqlite3/sqlite3_forge.php
  26. +64 −96 system/database/drivers/sqlsrv/sqlsrv_forge.php
  27. +1 −0 tests/mocks/database/db/driver.php
  28. +3 −3 tests/mocks/database/schema/skeleton.php
  29. +2 −0 user_guide_src/source/changelog.rst
  30. +4 −10 user_guide_src/source/database/forge.rst
  31. +26 −4 user_guide_src/source/installation/upgrade_300.rst
View
@@ -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();
}
Oops, something went wrong.

0 comments on commit a287a34

Please sign in to comment.