summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-27 19:36:23 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-27 19:36:23 +0100
commitf055fa98c7c7dbdd44ca485cde9efe112f713123 (patch)
tree1d40beb88970884e73caeb5ca184662834d5c2bf /system/database
parent3a91cabf0cb346bbd4d44fe249f9f726101ba310 (diff)
Add PHP version check in db_pconnect()
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php6
1 files changed, 6 insertions, 0 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);