diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-04-03 19:54:49 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-04-03 19:54:49 +0200 |
commit | fd105ab7f05e64c0d9188e43c6fd6a2bb2c6cf7f (patch) | |
tree | d16dc16ae5e81f6171a18b3278d48038406937bd /system/database/DB.php | |
parent | 5b46f42d654e7474a47ecfd9f7dafece98ee668e (diff) | |
parent | ab1d568b7b7bce779cd00c90cd99c6f43747575b (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-postgre
Diffstat (limited to 'system/database/DB.php')
-rwxr-xr-x | system/database/DB.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/system/database/DB.php b/system/database/DB.php index 96e495515..0d81e40d3 100755 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -92,16 +92,12 @@ function &DB($params = '', $active_record_override = NULL) if (isset($dsn['query'])) { parse_str($dsn['query'], $extra); + foreach ($extra as $key => $val) { - // booleans please - if (strtoupper($val) === 'TRUE') - { - $val = TRUE; - } - elseif (strtoupper($val) === 'FALSE') + if (is_string($val) && in_array(strtoupper($val), array('TRUE', 'FALSE', 'NULL'))) { - $val = FALSE; + $val = var_export($val); } $params[$key] = $val; @@ -138,7 +134,12 @@ function &DB($params = '', $active_record_override = NULL) class CI_DB extends CI_DB_driver { } } - require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php'); + // Load the DB driver + $driver_file = BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php'; + + if ( ! file_exists($driver_file)) show_error('Invalid DB driver'); + + require_once($driver_file); // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; |