summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB.php25
-rw-r--r--system/database/DB_driver.php2
2 files changed, 25 insertions, 2 deletions
diff --git a/system/database/DB.php b/system/database/DB.php
index 2446645a7..eb25273a1 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -66,10 +66,31 @@ function &DB($params = '', $active_record_override = FALSE)
'hostname' => (isset($dns['host'])) ? rawurldecode($dns['host']) : '',
'username' => (isset($dns['user'])) ? rawurldecode($dns['user']) : '',
'password' => (isset($dns['pass'])) ? rawurldecode($dns['pass']) : '',
- 'database' => (isset($dns['path'])) ? rawurldecode(substr($dns['host'], 1)) : ''
+ 'database' => (isset($dns['path'])) ? rawurldecode(substr($dns['path'], 1)) : ''
);
+
+ // were additional config items set?
+ if (isset($dns['query']))
+ {
+ parse_str($dns['query'], $extra);
+
+ foreach($extra as $key => $val)
+ {
+ // booleans please
+ if (strtoupper($val) == "TRUE")
+ {
+ $val = TRUE;
+ }
+ elseif (strtoupper($val) == "FALSE")
+ {
+ $val = FALSE;
+ }
+
+ $params[$key] = $val;
+ }
+ }
}
-
+
// No DB specified yet? Beat them senseless...
if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '')
{
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index a0833d0ce..c9cece621 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -36,6 +36,8 @@ class CI_DB_driver {
var $database;
var $dbdriver = 'mysql';
var $dbprefix = '';
+ var $char_set = '';
+ var $dbcollat = '';
var $autoinit = TRUE; // Whether to automatically initialize the DB
var $swap_pre = '';
var $port = '';