| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function connect(array $config) |
||
| 32 | { |
||
| 33 | // This connection string format can also be used to connect |
||
| 34 | // to Azure SQL Server databases. |
||
| 35 | $port = (isset($config['port'])) ? ',' . $config['port'] : ''; |
||
| 36 | |||
| 37 | //check for dblib for mac users connecting to mssql |
||
| 38 | if (isset($config['dsn_type']) && !empty($config['dsn_type']) && $config['dsn_type'] == 'dblib') { |
||
| 39 | $dsn = "dblib:host={$config['host']}{$port};dbname={$config['database']}"; |
||
| 40 | } else { |
||
| 41 | $dsn = "sqlsrv:Server={$config['host']}{$port};Database={$config['database']}"; |
||
| 42 | } |
||
| 43 | |||
| 44 | return new \Pimf\Database($dsn, $config['username'], $config['password'], $this->options($config)); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |