aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-24 17:59:04 +0100
committerTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-24 17:59:04 +0100
commit9059864dac2f1769d801bc2fb9ef49d0f03d9c6d (patch)
tree13172066ece9dd937cfdd0690b9fce419e89c8da
parent39538ecb856a632c1f9bac8284deb1cbea35e696 (diff)
parent57b226ec764c981204dd63efe9e05e1a8a9ef161 (diff)
downloadforums-9059864dac2f1769d801bc2fb9ef49d0f03d9c6d.tar
forums-9059864dac2f1769d801bc2fb9ef49d0f03d9c6d.tar.gz
forums-9059864dac2f1769d801bc2fb9ef49d0f03d9c6d.tar.bz2
forums-9059864dac2f1769d801bc2fb9ef49d0f03d9c6d.tar.xz
forums-9059864dac2f1769d801bc2fb9ef49d0f03d9c6d.zip
Merge pull request #4136 from marc1706/ticket/14425
[ticket/14425] Allow setting unix socket in database tests * marc1706/ticket/14425: [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 5d643e43e2..3b5bab749e 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -85,11 +85,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)