Added in a new method for checking pdo drivers

Added in a more dynamic method for checking whether to use dblib or
sqlsrv drivers for a mssql pdo connection. This is to make local mac
devs work well with windows prod machines.
This commit is contained in:
David Staley 2013-01-02 10:44:20 -07:00
parent f25d09dd07
commit 4cea38e0b3
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ public function connect($config)
$port = (isset($port)) ? ','.$port : ''; $port = (isset($port)) ? ','.$port : '';
//check for dblib for mac users connecting to mssql (utilizes freetds) //check for dblib for mac users connecting to mssql (utilizes freetds)
if (!empty($dsn_type) and $dsn_type == 'dblib') if (in_array('dblib',PDO::getAvailableDrivers()))
{ {
$dsn = "dblib:host={$host}{$port};dbname={$database}"; $dsn = "dblib:host={$host}{$port};dbname={$database}";
} }