Add user and password to dsn string
This commit is contained in:
parent
f34a6d28f7
commit
b1b3989152
|
@ -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'];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue