mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-12 06:56:24 +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' => '',
|
'password' => '',
|
||||||
'database' => 'cake',
|
'database' => 'cake',
|
||||||
'port' => '3306',
|
'port' => '3306',
|
||||||
'connect' => 'mysqli_connect',
|
'connect' => 'mysqli_connect'
|
||||||
'socket' => '/tmp/mysql.sock'
|
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* Mysqli column definition
|
* Mysqli column definition
|
||||||
|
@ -102,6 +101,14 @@ class DboMysqli extends DboSource {
|
||||||
function connect() {
|
function connect() {
|
||||||
$config = $this->config;
|
$config = $this->config;
|
||||||
$this->connected = false;
|
$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']);
|
$this->connection = mysqli_connect($config['host'], $config['login'], $config['password'], $config['database'], $config['port'], $config['socket']);
|
||||||
|
|
||||||
if ($this->connection !== false) {
|
if ($this->connection !== false) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue