Merge pull request #332 from IceShack/2.0

Add user and password to dsn string
This commit is contained in:
Toni Uebernickel 2015-07-22 08:30:19 +02:00
commit 429f6b5879

View file

@ -270,6 +270,14 @@ abstract class AbstractCommand extends ContainerAwareCommand
protected function getDsn($connectionName)
{
$connection = $this->getConnectionData($connectionName);
// Add user and password to dsn string
$dsn = explode(';', $connection['dsn']);
if (isset($connection['user'])) {
$dsn[] = 'user=' . urlencode($connection['user']);
}
if (isset($connection['password'])) {
$dsn[] = 'password=' . urlencode($connection['password']);
}
return $connection['dsn'];
}