mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing DboSybase::connect() to use port configuration value. Thanks 'tPl0ch' for the various attempts :) Fixes #90
This commit is contained in:
parent
508d737b6a
commit
dc220bbb21
1 changed files with 8 additions and 8 deletions
|
@ -89,17 +89,17 @@ class DboSybase extends DboSource {
|
|||
*/
|
||||
function connect() {
|
||||
$config = $this->config;
|
||||
$this->connected = false;
|
||||
|
||||
if (!$config['persistent']) {
|
||||
$this->connection = sybase_connect($config['host'], $config['login'], $config['password'], true);
|
||||
$port = '';
|
||||
if ($config['port'] !== null) {
|
||||
$port = ':' . $config['port'];
|
||||
}
|
||||
if ($config['persistent']) {
|
||||
$this->connection = sybase_connect($config['host'] . $port, $config['login'], $config['password'], true);
|
||||
} else {
|
||||
$this->connection = sybase_pconnect($config['host'], $config['login'], $config['password']);
|
||||
}
|
||||
|
||||
if (sybase_select_db($config['database'], $this->connection)) {
|
||||
$this->connected = true;
|
||||
$this->connection = sybase_pconnect($config['host'] . $port, $config['login'], $config['password']);
|
||||
}
|
||||
$this->connected = sybase_select_db($config['database'], $this->connection);
|
||||
return $this->connected;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue