Unverified Commit 2e9a2627 authored by Nicolas PAJON's avatar Nicolas PAJON Committed by GitHub

Update Driver.php

Adding Windows Authentication compatibility according to http://php.net/manual/en/function.sqlsrv-connect.php
"By default, the connection is attempted using Windows Authentication. To connect using SQL Server Authentication, include "UID" and "PWD" in the connection options array."
parent bef35e90
......@@ -31,8 +31,13 @@ class Driver extends AbstractSQLServerDriver
$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;
......
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