Skip to content

Commit

Permalink
Merge pull request #3333 from odinsey/master
Browse files Browse the repository at this point in the history
Allow windows (userless/passwordless) authentication for SQL Server
  • Loading branch information
morozov authored Nov 4, 2018
2 parents bef35e9 + 7cd248c commit 88b80bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ public function connect(array $params, $username = null, $password = null, array
$driverOptions['CharacterSet'] = $params['charset'];
}

$driverOptions['UID'] = $username;
$driverOptions['PWD'] = $password;
if ($username !== null) {
$driverOptions['UID'] = $username;
}

if ($password !== null) {
$driverOptions['PWD'] = $password;
}

if (! isset($driverOptions['ReturnDatesAsStrings'])) {
$driverOptions['ReturnDatesAsStrings'] = 1;
Expand Down

0 comments on commit 88b80bf

Please sign in to comment.