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:
nate 2007-11-30 22:23:57 +00:00
parent 625b86dc9b
commit ba59fad873

View file

@ -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.