Simplify a method in the connection manager

This commit is contained in:
Timothy Warren 2014-04-01 14:06:49 -04:00
parent 3fd4580721
commit 235f93bdc4
1 changed files with 2 additions and 5 deletions

View File

@ -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}";