diff options
Diffstat (limited to 'system/database/DB.php')
-rw-r--r-- | system/database/DB.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/system/database/DB.php b/system/database/DB.php index 7e6cd7466..f8d020493 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -102,13 +102,13 @@ function &DB($params = '', $query_builder_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)) : '' - ); + '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)) : '' + ); // Were additional config items set? if (isset($dsn['query'])) @@ -177,11 +177,7 @@ function &DB($params = '', $query_builder_override = NULL) // 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'); - } - + file_exists($driver_file) OR show_error('Invalid DB driver'); require_once($driver_file); // Instantiate the DB adapter |