Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

added port recognition to db host #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions b8/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down