Remove some dead code from the connection manager

This commit is contained in:
Timothy Warren 2018-01-23 11:29:43 -05:00
parent e4ca039b3d
commit 908b9f39cd
1 changed files with 3 additions and 11 deletions

View File

@ -129,7 +129,7 @@ final class ConnectionManager {
$driver = "\\Query\\Drivers\\{$dbtype}\\Driver"; $driver = "\\Query\\Drivers\\{$dbtype}\\Driver";
// Create the database connection // Create the database connection
$db = ( ! empty($params->user)) $db = ! empty($params->user)
? new $driver($dsn, $params->user, $params->pass, $options) ? new $driver($dsn, $params->user, $params->pass, $options)
: new $driver($dsn, '', '', $options); : new $driver($dsn, '', '', $options);
@ -184,18 +184,10 @@ final class ConnectionManager {
} }
// Create the dsn for the database to connect to // Create the dsn for the database to connect to
if (strtolower($dbtype) === 'firebird') if(strtolower($dbtype) === 'sqlite')
{
$dsn = "{$params->host}:{$params->file}";
}
else if(strtolower($dbtype) === 'sqlite')
{ {
$dsn = $params->file; $dsn = $params->file;
} }
else if(strtolower($dbtype) === 'oci')
{
$dsn = "dbname=//{$params->host}:{$params->port}/{$params->database}";
}
else else
{ {
$dsn = $this->createDsn($dbtype, $params); $dsn = $this->createDsn($dbtype, $params);
@ -234,7 +226,7 @@ final class ConnectionManager {
foreach($params as $key => $val) foreach($params as $key => $val)
{ {
if (( ! array_key_exists($key, $skip)) && ( ! empty($val))) if (( ! array_key_exists($key, $skip)) && ! empty($val))
{ {
$pairs[] = implode('=', [$key, $val]); $pairs[] = implode('=', [$key, $val]);
} }