Commit 546b2fa1 authored by Leo Gordon's avatar Leo Gordon
Browse files

Allow skipping the port number; you no longer need to define your port if you...

Allow skipping the port number; you no longer need to define your port if you are happy with driver's default (thanks to db_conn.pl and core's DBConnection)
parent ee51e74e
......@@ -313,10 +313,11 @@ sub dbconn_2_url {
$with_db = 1 unless(defined($with_db));
my $driver = $self->o($db_conn, '-driver');
my $port = $self->o($db_conn,'-port');
return ( ($driver eq 'sqlite')
? $driver.':///'
: $driver.'://'.$self->o($db_conn,'-user').':'.$self->o($db_conn,'-pass').'@'.$self->o($db_conn,'-host').':'.$self->o($db_conn,'-port').'/'
: $driver.'://'.$self->o($db_conn,'-user').':'.$self->o($db_conn,'-pass').'@'.$self->o($db_conn,'-host').($port ? ':'.$port : '').'/'
) . ($with_db ? $self->o($db_conn,'-dbname') : '');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment