aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/db/mysqli.php9
2 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 3940888216..03b1102602 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.0.9');
+define('PHPBB_VERSION', '3.0.10-dev');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index 862d62f4ba..dcf8727e18 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -33,13 +33,16 @@ class dbal_mysqli extends dbal
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false , $new_link = false)
{
- $this->persistency = $persistency;
+ // Mysqli extension supports persistent connection since PHP 5.3.0
+ $this->persistency = (version_compare(PHP_VERSION, '5.3.0', '>=')) ? $persistency : false;
$this->user = $sqluser;
- $this->server = $sqlserver;
+
+ // If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix
+ $this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver;
+
$this->dbname = $database;
$port = (!$port) ? NULL : $port;
- // Persistant connections not supported by the mysqli extension?
$this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port);
if ($this->db_connect_id && $this->dbname != '')