diff options
author | Andrey Andreev <narf@devilix.net> | 2014-02-27 14:43:24 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-02-27 14:43:24 +0100 |
commit | 7e96351e4e420ff92eae4904826a49c14ebec7c0 (patch) | |
tree | 59a3078ba1f7cec91953b9a3ccafe5fa236a0d84 /system/database/DB.php | |
parent | 59f042652eb19db118ae5009c0e4a8dbf154b420 (diff) |
Call db_connect(TRUE) instead of db_pconnect() + some style changes
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 |