mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Adding fix for Ticket #2347
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4785 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
56451426fb
commit
ba8421cce2
1 changed files with 19 additions and 1 deletions
|
@ -89,7 +89,16 @@ class DboMysqli extends DboSource {
|
|||
*/
|
||||
function connect() {
|
||||
$config = $this->config;
|
||||
$this->connected = false;
|
||||
$this->connection = mysqli_connect($config['host'], $config['login'], $config['password'], $config['database'], $config['port']);
|
||||
|
||||
if ($this->connection !== false) {
|
||||
$this->connected = true;
|
||||
}
|
||||
|
||||
if (!empty($config['encoding'])) {
|
||||
$this->setEncoding($config['encoding']);
|
||||
}
|
||||
return $this->connected;
|
||||
}
|
||||
/**
|
||||
|
@ -412,6 +421,15 @@ class DboMysqli extends DboSource {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the database encoding
|
||||
*
|
||||
* @param string $enc Database encoding
|
||||
* @return void
|
||||
*/
|
||||
function setEncoding($enc) {
|
||||
return $this->_execute('SET NAMES ' . $enc) != false;
|
||||
}
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
|
@ -428,4 +446,4 @@ class DboMysqli extends DboSource {
|
|||
return $query;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue