You are here

public function ConnectionSettings::buildDSN in Drupal driver for SQL Server and SQL Azure 8.2

Build the connection string.

Parameters

array $options:

Return value

string

File

drivers/lib/Drupal/Driver/Database/sqlsrv/ConnectionSettings.php, line 158

Class

ConnectionSettings
Global settings for the driver.

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function buildDSN(array $options) {

  // Merge the original options with the
  // aditional DSN settings.
  $options = $options + $this
    ->GetAdditionalDSN();
  $dsn = 'sqlsrv:';
  foreach ($options as $key => $value) {
    $dsn .= (empty($key) ? '' : "{$key}=") . $value . ';';
  }
  return $dsn;
}