From e0f447c9b6b47709bc59b2ea03095d4fff64cd1c Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 4 May 2016 10:34:43 +0200 Subject: [PATCH] Force li3 connections to ignore Host/Port settings if a socket is provided. --- Changelog | 1 + app/config/bootstrap/connections.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index d75e08321..fa03f7fa5 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2016-05-04 DariusIII + * Fix: Force li3 connections to ignore Host/Port settings if a socket is provided. * Upd: Add patch for triggers to match the new releases reqid format (@rainje) 2016-05-01 DariusIII * Upd: Revert updating process to original version diff --git a/app/config/bootstrap/connections.php b/app/config/bootstrap/connections.php index 49f4be83a..95535bafe 100644 --- a/app/config/bootstrap/connections.php +++ b/app/config/bootstrap/connections.php @@ -91,17 +91,23 @@ if (file_exists($config)) { } if (isset($adapter)) { + $host = $port = ''; + if (empty(DB_SOCKET)) { + $host = DB_HOST; + $port = DB_PORT; + } Connections::add('default', [ 'type' => 'database', 'adapter' => $adapter, - 'host' => DB_HOST, - 'port' => DB_PORT, + 'host' => $host, + 'port' => $port, 'login' => DB_USER, 'password' => DB_PASSWORD, 'database' => DB_NAME, 'encoding' => 'UTF-8', - 'persistent' => false + 'persistent' => false, + 'socket' => DB_SOCKET, ] ); }