Commit db351fed authored by Samuel Fitz's avatar Samuel Fitz

added dblib option to sqlsrv connector class /sam fitz (abigwonderful)

simple conditional added to look for dsn type. if set and is dblib,
syntax for PDO connection adjusted slightly to allow for mac connection
to mssql server (utilizing freetds)
parent d9802fe6
...@@ -29,7 +29,15 @@ class SQLServer extends Connector { ...@@ -29,7 +29,15 @@ class SQLServer extends Connector {
// directly after the server name, so we'll create that first. // directly after the server name, so we'll create that first.
$port = (isset($port)) ? ','.$port : ''; $port = (isset($port)) ? ','.$port : '';
//check for dblib for mac users connecting to mssql (utilizes freetds)
if (!empty($dsn_type) and $dsn_type == 'dblib')
{
$dsn = "dblib:host={$host}{$port};dbname={$database}";
}
else
{
$dsn = "sqlsrv:Server={$host}{$port};Database={$database}"; $dsn = "sqlsrv:Server={$host}{$port};Database={$database}";
}
return new PDO($dsn, $username, $password, $this->options($config)); return new PDO($dsn, $username, $password, $this->options($config));
} }
......
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