mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Adding non-persistent connection fix for MS SQL (Ticket #3454)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6097 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
625b86dc9b
commit
ba59fad873
1 changed files with 7 additions and 2 deletions
|
@ -73,7 +73,6 @@ class DboMssql extends DboSource {
|
||||||
'password' => '',
|
'password' => '',
|
||||||
'database' => 'cake',
|
'database' => 'cake',
|
||||||
'port' => '1433',
|
'port' => '1433',
|
||||||
'connect' => 'mssql_pconnect'
|
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* MS SQL column definition
|
* MS SQL column definition
|
||||||
|
@ -136,11 +135,17 @@ class DboMssql extends DboSource {
|
||||||
} else {
|
} else {
|
||||||
$port = '\\' . $config['port']; // Named pipe
|
$port = '\\' . $config['port']; // Named pipe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$config['persistent'] || (isset($config['connect']) && $config['connect'] === 'mssql_connect')) {
|
||||||
|
$this->connection = $connect($config['host'] . $port, $config['login'], $config['password'], true);
|
||||||
|
} else {
|
||||||
$this->connection = $connect($config['host'] . $port, $config['login'], $config['password']);
|
$this->connection = $connect($config['host'] . $port, $config['login'], $config['password']);
|
||||||
|
}
|
||||||
|
|
||||||
if (mssql_select_db($config['database'], $this->connection)) {
|
if (mssql_select_db($config['database'], $this->connection)) {
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
}
|
}
|
||||||
|
pr($this->connection);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Disconnects from database.
|
* Disconnects from database.
|
||||||
|
|
Loading…
Add table
Reference in a new issue