summaryrefslogtreecommitdiffstats
path: root/system/database/DB.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-06 20:49:57 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-06 20:49:57 +0200
commit89ba83c811338134030ef051626e38e3876bc762 (patch)
tree24e3b8b6f738c9a7443e88312c808787dacb14fa /system/database/DB.php
parent11c111c3ff128791f571ac2519bb796baecf7226 (diff)
parentea09a8a5552f2aacdeab0c88a605fe44047ebd0a (diff)
Merge upstream branch
Diffstat (limited to 'system/database/DB.php')
-rwxr-xr-xsystem/database/DB.php17
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';