Merge branch '3.1.x'

* 3.1.x:
  [ticket/14425] Allow setting unix socket in database tests
This commit is contained in:
Tristan Darricau 2016-01-24 18:00:26 +01:00
commit 36ff2c7b59

View file

@ -84,11 +84,18 @@ class phpbb_database_test_connection_manager
break; break;
default: default:
$dsn .= 'host=' . $this->config['dbhost']; if (!empty($this->config['dbport']) && !is_numeric($this->config['dbport']) && $this->dbms['PDO'] != 'pgsql')
if ($this->config['dbport'])
{ {
$dsn .= ';port=' . $this->config['dbport']; $dsn .= 'unix_socket=' . $this->config['dbport'];
}
else
{
$dsn .= 'host=' . $this->config['dbhost'];
if ($this->config['dbport'])
{
$dsn .= ';port=' . $this->config['dbport'];
}
} }
if ($use_db) if ($use_db)