Fixing DboSybase::connect() to use port configuration value. Thanks 'tPl0ch' for the various attempts :) Fixes #90

This commit is contained in:
mark_story 2009-09-29 20:43:17 -04:00
parent 508d737b6a
commit dc220bbb21

View file

@ -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;
}
/**