mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
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:
parent
d14774324a
commit
1b1a3d7a5a
1 changed files with 9 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue