summaryrefslogtreecommitdiffstats
path: root/system/database/DB.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-26 12:07:55 +0200
committerAndrey Andreev <narf@bofh.bg>2012-03-26 12:07:55 +0200
commited1aa21dcd5312b2884f140be8c0d2ee94379423 (patch)
tree9fef4a1e0cb43494e75585fbfa9b15010a801b96 /system/database/DB.php
parent35bbb1ab4f7ee09d75fb407c6d9d9637b4404698 (diff)
parentc2697db0f2721cc9fefb58b85bf55e6bdb91db9b (diff)
Merge upstream branch
Diffstat (limited to 'system/database/DB.php')
-rwxr-xr-xsystem/database/DB.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/system/database/DB.php b/system/database/DB.php
index 7c12e562b..96e495515 100755
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -37,11 +37,11 @@
function &DB($params = '', $active_record_override = NULL)
{
// Load the DB config file if a DSN string wasn't passed
- if (is_string($params) AND strpos($params, '://') === FALSE)
+ if (is_string($params) && strpos($params, '://') === FALSE)
{
// Is the config file in the environment folder?
if (( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database.php'))
- AND ! file_exists($file_path = APPPATH.'config/database.php'))
+ && ! file_exists($file_path = APPPATH.'config/database.php'))
{
show_error('The configuration file database.php does not exist.');
}
@@ -81,11 +81,11 @@ function &DB($params = '', $active_record_override = NULL)
$params = array(
'dbdriver' => $dsn['scheme'],
- 'hostname' => (isset($dsn['host'])) ? rawurldecode($dsn['host']) : '',
- 'port' => (isset($dsn['port'])) ? rawurldecode($dsn['port']) : '',
- 'username' => (isset($dsn['user'])) ? rawurldecode($dsn['user']) : '',
- 'password' => (isset($dsn['pass'])) ? rawurldecode($dsn['pass']) : '',
- 'database' => (isset($dsn['path'])) ? rawurldecode(substr($dsn['path'], 1)) : ''
+ 'hostname' => isset($dsn['host']) ? rawurldecode($dsn['host']) : '',
+ 'port' => isset($dsn['port']) ? rawurldecode($dsn['port']) : '',
+ 'username' => isset($dsn['user']) ? rawurldecode($dsn['user']) : '',
+ 'password' => isset($dsn['pass']) ? rawurldecode($dsn['pass']) : '',
+ 'database' => isset($dsn['path']) ? rawurldecode(substr($dsn['path'], 1)) : ''
);
// were additional config items set?
@@ -104,10 +104,7 @@ function &DB($params = '', $active_record_override = NULL)
$val = FALSE;
}
- if ( ! isset($params[$key]))
- {
- $params[$key] = $val;
- }
+ $params[$key] = $val;
}
}
}