Reverting last change to DboMysqli, and we now use port config var as the socket if it is a string.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7093 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
joelmoss 2008-06-02 19:00:11 +00:00
parent d14774324a
commit 1b1a3d7a5a

View file

@ -73,8 +73,7 @@ class DboMysqli extends DboSource {
'password' => '',
'database' => 'cake',
'port' => '3306',
'connect' => 'mysqli_connect',
'socket' => '/tmp/mysql.sock'
'connect' => 'mysqli_connect'
);
/**
* Mysqli column definition
@ -102,6 +101,14 @@ class DboMysqli extends DboSource {
function connect() {
$config = $this->config;
$this->connected = false;
if (is_numeric($config['port'])) {
$config['socket'] = null;
} else {
$config['socket'] = $config['port'];
$config['port'] = null;
}
$this->connection = mysqli_connect($config['host'], $config['login'], $config['password'], $config['database'], $config['port'], $config['socket']);
if ($this->connection !== false) {