mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
MINOR Changed the way MSSQLAzureDatabase connects
This commit is contained in:
parent
2a1cee6f3a
commit
72a1381455
@ -23,11 +23,16 @@ class MSSQLAzureDatabase extends MSSQLDatabase {
|
||||
protected $fullTextEnabled = false;
|
||||
|
||||
public function __construct($parameters) {
|
||||
$this->connectDatabase($parameters);
|
||||
$this->dbConn = $this->connectDatabase($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to a SQL Azure database with the given parameters.
|
||||
* @param array $parameters Connection parameters set by environment
|
||||
* @return resource SQL Azure database connection link
|
||||
*/
|
||||
protected function connectDatabase($parameters) {
|
||||
$this->dbConn = sqlsrv_connect($parameters['server'], array(
|
||||
$conn = sqlsrv_connect($parameters['server'], array(
|
||||
'Database' => $parameters['database'],
|
||||
'UID' => $parameters['username'],
|
||||
'PWD' => $parameters['password'],
|
||||
@ -40,9 +45,10 @@ class MSSQLAzureDatabase extends MSSQLDatabase {
|
||||
$this->mssql = false; // mssql functions don't work with this database
|
||||
$this->fullTextEnabled = false;
|
||||
|
||||
// Configure the connection
|
||||
$this->query('SET QUOTED_IDENTIFIER ON');
|
||||
$this->query('SET TEXTSIZE 2147483647');
|
||||
|
||||
return $conn
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user