summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorMichiel Vugteveen <michiel@it-can.nl>2012-08-20 18:52:21 +0200
committerMichiel Vugteveen <michiel@it-can.nl>2012-08-20 18:52:21 +0200
commit49f7b729b3633d7f29029b7800dde5cc47a022c8 (patch)
tree8d665a52161941158538c14b85c87f2c55754d1d /system/database
parentc27721fbd02511c168f4c353e4f5eac1b2049e9f (diff)
mysql driver updated
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php18
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php8
2 files changed, 21 insertions, 5 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 29db90408..35473016f 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -83,7 +83,14 @@ class CI_DB_mysql_driver extends CI_DB {
*/
public function db_connect()
{
- return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
+ if ($this->compress === TRUE)
+ {
+ return @mysql_connect($this->hostname, $this->username, $this->password, TRUE, MYSQL_CLIENT_COMPRESS);
+ }
+ else
+ {
+ return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
+ }
}
// --------------------------------------------------------------------
@@ -95,7 +102,14 @@ class CI_DB_mysql_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @mysql_pconnect($this->hostname, $this->username, $this->password);
+ if ($this->compress === TRUE)
+ {
+ return @mysql_pconnect($this->hostname, $this->username, $this->password, MYSQL_CLIENT_COMPRESS);
+ }
+ else
+ {
+ return @mysql_pconnect($this->hostname, $this->username, $this->password);
+ }
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 475857c84..947c47784 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -67,10 +67,12 @@ class CI_DB_mysqli_driver extends CI_DB {
{
if ($this->compress === TRUE)
{
- $port = NULL;
+ $port = empty($this->port) ? NULL : $this->port;
- $mysqli = mysqli_init();
- return $mysqli->real_connect($this->hostname, $this->username, $this->password, $this->database, $port, NULL, MYSQLI_CLIENT_COMPRESS);
+ $link = mysqli_init();
+ $link->real_connect($this->hostname, $this->username, $this->password, $this->database, $port, NULL, MYSQLI_CLIENT_COMPRESS);
+
+ return $link;
}
return empty($this->port)