aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-24 18:00:26 +0100
committerTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-24 18:00:26 +0100
commit36ff2c7b59ecd0efa999f0321cf43feebae0f33b (patch)
treeb270c4f172c2a55b25f0863c9f24344039bc511e
parent9d23bf1ec504dacd58a9e89b65cde26682f42fd3 (diff)
parent9059864dac2f1769d801bc2fb9ef49d0f03d9c6d (diff)
downloadforums-36ff2c7b59ecd0efa999f0321cf43feebae0f33b.tar
forums-36ff2c7b59ecd0efa999f0321cf43feebae0f33b.tar.gz
forums-36ff2c7b59ecd0efa999f0321cf43feebae0f33b.tar.bz2
forums-36ff2c7b59ecd0efa999f0321cf43feebae0f33b.tar.xz
forums-36ff2c7b59ecd0efa999f0321cf43feebae0f33b.zip
Merge branch '3.1.x'
* 3.1.x: [ticket/14425] Allow setting unix socket in database tests
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index fa50d89a70..27ac64e21d 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -84,11 +84,18 @@ class phpbb_database_test_connection_manager
break;
default:
- $dsn .= 'host=' . $this->config['dbhost'];
-
- if ($this->config['dbport'])
+ if (!empty($this->config['dbport']) && !is_numeric($this->config['dbport']) && $this->dbms['PDO'] != 'pgsql')
+ {
+ $dsn .= 'unix_socket=' . $this->config['dbport'];
+ }
+ else
{
- $dsn .= ';port=' . $this->config['dbport'];
+ $dsn .= 'host=' . $this->config['dbhost'];
+
+ if ($this->config['dbport'])
+ {
+ $dsn .= ';port=' . $this->config['dbport'];
+ }
}
if ($use_db)