From 15221f86eabb98b68497c256422c2ff251799814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Grundko=CC=88tter?= Date: Wed, 19 Nov 2014 17:10:11 +0100 Subject: [PATCH] - added port recognition to db host --- b8/Database.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/b8/Database.php b/b8/Database.php index b856506..c0c8fab 100755 --- a/b8/Database.php +++ b/b8/Database.php @@ -92,6 +92,11 @@ public static function getConnection($type = 'read') // Pull the next server: $server = array_shift($servers); + if (stristr($server, ':')) { + list($host, $port) = explode(':', $server); + $server = $host . ';port=' . $port; + } + // Try to connect: try { $connection = new self('mysql:host=' . $server . ';dbname=' . self::$details['db'],