summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php6
-rw-r--r--user_guide_src/source/changelog.rst2
2 files changed, 7 insertions, 1 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index c6ffb4929..a79b2a4ad 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -85,6 +85,12 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
public function db_pconnect()
{
+ // Persistent connection support was added in PHP 5.3.0
+ if ( ! is_php('5.3'))
+ {
+ return $this->db_connect();
+ }
+
return ($this->port != '')
? @mysqli_connect('p:'.$this->hostname, $this->username, $this->password, $this->database, $this->port)
: @mysqli_connect('p:'.$this->hostname, $this->username, $this->password, $this->database);
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index bc77b201b..e27ff8877 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -48,7 +48,7 @@ Release Date: Not Released
- Taking care of LIKE condition when used with MySQL UPDATE statement.
- Adding $escape parameter to the order_by function, this enables ordering by custom fields.
- MySQLi driver now uses mysqli_get_server_info() for server version checking.
- - MySQLi driver now supports persistent connections.
+ - MySQLi driver now supports persistent connections when running on PHP >= 5.3.
- Libraries