Simplify a method in the connection manager
This commit is contained in:
parent
3fd4580721
commit
235f93bdc4
@ -212,15 +212,12 @@ final class Connection_Manager {
|
||||
*/
|
||||
private function create_dsn($dbtype, $params)
|
||||
{
|
||||
// Add the driver type to the dsn
|
||||
$dsn = ($dbtype !== 'firebird' && $dbtype !== 'sqlite')
|
||||
? strtolower($dbtype).':'
|
||||
: '';
|
||||
|
||||
if ($dbtype === 'firebird') $dsn = "{$params->host}:{$params->file}";
|
||||
elseif ($dbtype === 'sqlite') $dsn = $params->file;
|
||||
else
|
||||
{
|
||||
$dsn = strtolower($dbtype) . ':';
|
||||
|
||||
if ( ! empty($params->database))
|
||||
{
|
||||
$dsn .= "dbname={$params->database}";
|
||||
|
Loading…
Reference in New Issue
Block a user