diff options
author | Michiel Vugteveen <michiel@it-can.nl> | 2012-08-20 18:34:24 +0200 |
---|---|---|
committer | Michiel Vugteveen <michiel@it-can.nl> | 2012-08-20 18:34:24 +0200 |
commit | c27721fbd02511c168f4c353e4f5eac1b2049e9f (patch) | |
tree | ab30f925c62c84b6fed3ba1d25672951dd4191db /system | |
parent | 0b1d56f08b5d95046a367ed65c7aef6c8d717bc3 (diff) |
compression test
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_driver.php | 1 | ||||
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index d63a1d955..4296815f8 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -51,6 +51,7 @@ abstract class CI_DB_driver { public $char_set = 'utf8'; public $dbcollat = 'utf8_general_ci'; public $autoinit = TRUE; // Whether to automatically initialize the DB + public $compress = TRUE; public $swap_pre = ''; public $port = ''; public $pconnect = FALSE; diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index be61aab20..475857c84 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -65,6 +65,14 @@ class CI_DB_mysqli_driver extends CI_DB { */ public function db_connect() { + if ($this->compress === TRUE) + { + $port = NULL; + + $mysqli = mysqli_init(); + return $mysqli->real_connect($this->hostname, $this->username, $this->password, $this->database, $port, NULL, MYSQLI_CLIENT_COMPRESS); + } + return empty($this->port) ? @new mysqli($this->hostname, $this->username, $this->password, $this->database) : @new mysqli($this->hostname, $this->username, $this->password, $this->database, $this->port); |